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 committed Dec 15, 2023
1 parent f717720 commit 3be029b
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 3be029b

Please sign in to comment.