pub unsafe trait MTLDrawable: NSObjectProtocol {
// Provided methods
fn present(&self)
where Self: Sized + Message { ... }
fn presentAtTime(&self, presentation_time: CFTimeInterval)
where Self: Sized + Message { ... }
fn presentAfterMinimumDuration(&self, duration: CFTimeInterval)
where Self: Sized + Message { ... }
unsafe fn addPresentedHandler(&self, block: MTLDrawablePresentedHandler)
where Self: Sized + Message { ... }
fn presentedTime(&self) -> CFTimeInterval
where Self: Sized + Message { ... }
fn drawableID(&self) -> NSUInteger
where Self: Sized + Message { ... }
}Available on crate feature
MTLDrawable only.Expand description
All “drawable” objects (such as those coming from CAMetalLayer) are expected to conform to this protocol
See also Apple’s documentation
Provided Methods§
fn present(&self)
fn presentAtTime(&self, presentation_time: CFTimeInterval)
Available on crate feature
objc2-core-foundation only.Sourcefn presentAfterMinimumDuration(&self, duration: CFTimeInterval)
Available on crate feature objc2-core-foundation only.
fn presentAfterMinimumDuration(&self, duration: CFTimeInterval)
objc2-core-foundation only.Present this drawable while setting a minimum duration in seconds before allowing this drawable to appear on the display.
Parameter duration: Duration in seconds before this drawable is allowed to appear on the display
Sourceunsafe fn addPresentedHandler(&self, block: MTLDrawablePresentedHandler)
Available on crate feature block2 only.
unsafe fn addPresentedHandler(&self, block: MTLDrawablePresentedHandler)
block2 only.Add a block to be called when this drawable is presented on screen.
§Safety
block must be a valid pointer.
Sourcefn presentedTime(&self) -> CFTimeInterval
Available on crate feature objc2-core-foundation only.
fn presentedTime(&self) -> CFTimeInterval
objc2-core-foundation only.The host time that this drawable was presented on screen.
Returns 0 if a frame has not been presented or has been skipped.
Sourcefn drawableID(&self) -> NSUInteger
fn drawableID(&self) -> NSUInteger
The monotonically incremented ID for all MTLDrawable objects created from the same CAMetalLayer object.
The value starts from 0.