objc2-open-gl-es 0.3.2

Bindings to the OpenGLES framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    /// *********************************************************************
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/opengles/keagldrawablepropertyretainedbacking?language=objc)
    pub static kEAGLDrawablePropertyRetainedBacking: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/opengles/keagldrawablepropertycolorformat?language=objc)
    pub static kEAGLDrawablePropertyColorFormat: &'static NSString;
}

extern "C" {
    /// *********************************************************************
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/opengles/keaglcolorformatrgba8?language=objc)
    pub static kEAGLColorFormatRGBA8: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/opengles/keaglcolorformatrgb565?language=objc)
    pub static kEAGLColorFormatRGB565: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/opengles/keaglcolorformatsrgba8?language=objc)
    pub static kEAGLColorFormatSRGBA8: &'static NSString;
}

extern_protocol!(
    /// *********************************************************************
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/opengles/eagldrawable?language=objc)
    pub unsafe trait EAGLDrawable {
        #[unsafe(method(drawableProperties))]
        #[unsafe(method_family = none)]
        unsafe fn drawableProperties(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

        /// Setter for [`drawableProperties`][Self::drawableProperties].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `drawable_properties` generic should be of the correct type.
        #[unsafe(method(setDrawableProperties:))]
        #[unsafe(method_family = none)]
        unsafe fn setDrawableProperties(
            &self,
            drawable_properties: Option<&NSDictionary<NSString, AnyObject>>,
        );
    }
);

/// EAGLContextDrawableAdditions.
#[cfg(feature = "EAGL")]
impl EAGLContext {
    extern_methods!(
        #[unsafe(method(renderbufferStorage:fromDrawable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn renderbufferStorage_fromDrawable(
            &self,
            target: NSUInteger,
            drawable: Option<&ProtocolObject<dyn EAGLDrawable>>,
        ) -> bool;

        #[unsafe(method(presentRenderbuffer:))]
        #[unsafe(method_family = none)]
        pub unsafe fn presentRenderbuffer(&self, target: NSUInteger) -> bool;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(presentRenderbuffer:atTime:))]
        #[unsafe(method_family = none)]
        pub unsafe fn presentRenderbuffer_atTime(
            &self,
            target: NSUInteger,
            presentation_time: CFTimeInterval,
        ) -> bool;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(presentRenderbuffer:afterMinimumDuration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn presentRenderbuffer_afterMinimumDuration(
            &self,
            target: NSUInteger,
            duration: CFTimeInterval,
        ) -> bool;
    );
}