pub unsafe trait MTKViewDelegate: NSObjectProtocol + MainThreadOnly {
// Provided methods
fn mtkView_drawableSizeWillChange(&self, view: &MTKView, size: CGSize)
where Self: Sized + Message { ... }
fn drawInMTKView(&self, view: &MTKView)
where Self: Sized + Message { ... }
}Available on crate feature
MTKView only.Expand description
Allows an object to render into the view and respond to resize events
See also Apple’s documentation
Provided Methods§
Sourcefn mtkView_drawableSizeWillChange(&self, view: &MTKView, size: CGSize)
Available on crate feature objc2-app-kit and crate feature objc2-core-foundation and macOS only.
fn mtkView_drawableSizeWillChange(&self, view: &MTKView, size: CGSize)
objc2-app-kit and crate feature objc2-core-foundation and macOS only.Called whenever the drawableSize of the view will change
Delegate can recompute view and projection matricies or regenerate any buffers to be compatible with the new view size or resolution
Parameter view: MTKView which called this method
Parameter size: New drawable size in pixels
Sourcefn drawInMTKView(&self, view: &MTKView)
Available on crate feature objc2-app-kit and macOS only.
fn drawInMTKView(&self, view: &MTKView)
objc2-app-kit and macOS only.Called on the delegate when it is asked to render into the view
Called on the delegate when it is asked to render into the view