objc2-metal 0.2.2

Bindings to the Metal framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

#[cfg(feature = "block2")]
pub type MTLDrawablePresentedHandler =
    *mut block2::Block<dyn Fn(NonNull<ProtocolObject<dyn MTLDrawable>>)>;

extern_protocol!(
    pub unsafe trait MTLDrawable: NSObjectProtocol + IsRetainable {
        #[method(present)]
        fn present(&self);

        #[method(presentAtTime:)]
        unsafe fn presentAtTime(&self, presentation_time: CFTimeInterval);

        #[method(presentAfterMinimumDuration:)]
        unsafe fn presentAfterMinimumDuration(&self, duration: CFTimeInterval);

        #[cfg(feature = "block2")]
        #[method(addPresentedHandler:)]
        unsafe fn addPresentedHandler(&self, block: MTLDrawablePresentedHandler);

        #[method(presentedTime)]
        unsafe fn presentedTime(&self) -> CFTimeInterval;

        #[method(drawableID)]
        fn drawableID(&self) -> NSUInteger;
    }

    unsafe impl ProtocolType for dyn MTLDrawable {}
);