diff --git a/src/drawable.rs b/src/drawable.rs index 5c03584..032f96f 100644 --- a/src/drawable.rs +++ b/src/drawable.rs @@ -5,8 +5,12 @@ // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. +use block::Block; + use super::NSUInteger; +type DrawablePresentedHandler<'a> = Block<(&'a DrawableRef,), ()>; + /// See pub enum MTLDrawable {} @@ -23,4 +27,8 @@ impl DrawableRef { pub fn drawable_id(&self) -> NSUInteger { unsafe { msg_send![self, drawableID] } } + + pub fn add_presented_handler(&self, block: &DrawablePresentedHandler) { + unsafe { msg_send![self, addPresentedHandler: block] } + } }