From 8e92adcf2ca9c0b5531395109cb0eb9429ec552f Mon Sep 17 00:00:00 2001 From: "m. pabst" Date: Fri, 15 Dec 2023 19:24:28 +0000 Subject: [PATCH] add presented_time to MTLDrawable --- src/drawable.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/drawable.rs b/src/drawable.rs index 032f96f..4c1877b 100644 --- a/src/drawable.rs +++ b/src/drawable.rs @@ -10,6 +10,7 @@ use block::Block; use super::NSUInteger; type DrawablePresentedHandler<'a> = Block<(&'a DrawableRef,), ()>; +type CFTimeInterval = f64; /// See pub enum MTLDrawable {} @@ -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] } + } }