pub struct Drawable(/* private fields */);Expand description
A displayable resource that can be rendered to.
C++ equivalent: MTL::Drawable
The drawable protocol represents a displayable resource. Drawables are typically obtained from a CAMetalLayer and are used as render targets.
Implementations§
Source§impl Drawable
impl Drawable
Sourcepub fn present_at_time(&self, presentation_time: TimeInterval)
pub fn present_at_time(&self, presentation_time: TimeInterval)
Present the drawable at the specified time.
C++ equivalent: void presentAtTime(CFTimeInterval presentationTime)
§Arguments
presentation_time- The host time at which to present the drawable.
Sourcepub fn present_after_minimum_duration(&self, duration: TimeInterval)
pub fn present_after_minimum_duration(&self, duration: TimeInterval)
Present the drawable after a minimum duration.
C++ equivalent: void presentAfterMinimumDuration(CFTimeInterval duration)
§Arguments
duration- The minimum duration before presenting.
Sourcepub fn drawable_id(&self) -> UInteger
pub fn drawable_id(&self) -> UInteger
Get the unique identifier for this drawable.
C++ equivalent: NS::UInteger drawableID() const
Sourcepub fn presented_time(&self) -> TimeInterval
pub fn presented_time(&self) -> TimeInterval
Get the time at which this drawable was presented.
C++ equivalent: CFTimeInterval presentedTime() const
Returns 0.0 if the drawable has not been presented yet.
Sourcepub fn add_presented_handler<F>(&self, handler: F)
pub fn add_presented_handler<F>(&self, handler: F)
Add a handler to be called when the drawable is presented.
C++ equivalent: void addPresentedHandler(void (^)(Drawable*))
The handler is called when the drawable has been presented to the display.