Skip to content

Commit

Permalink
add presented_time to MTLDrawable
Browse files Browse the repository at this point in the history
  • Loading branch information
m. pabst authored and grovesNL committed May 23, 2024
1 parent 7fc7381 commit 8e92adc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/drawable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use block::Block;
use super::NSUInteger;

type DrawablePresentedHandler<'a> = Block<(&'a DrawableRef,), ()>;
type CFTimeInterval = f64;

/// See <https://developer.apple.com/documentation/metal/mtldrawable>
pub enum MTLDrawable {}
Expand All @@ -31,4 +32,8 @@ impl DrawableRef {
pub fn add_presented_handler(&self, block: &DrawablePresentedHandler) {
unsafe { msg_send![self, addPresentedHandler: block] }
}

pub fn presented_time(&self) -> CFTimeInterval {
unsafe { msg_send![self, presentedTime] }
}
}

0 comments on commit 8e92adc

Please sign in to comment.