objc2_open_gl_es/generated/
EAGLDrawable.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern "C" {
13    /// *********************************************************************
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/opengles/keagldrawablepropertyretainedbacking?language=objc)
16    pub static kEAGLDrawablePropertyRetainedBacking: &'static NSString;
17}
18
19extern "C" {
20    /// [Apple's documentation](https://developer.apple.com/documentation/opengles/keagldrawablepropertycolorformat?language=objc)
21    pub static kEAGLDrawablePropertyColorFormat: &'static NSString;
22}
23
24extern "C" {
25    /// *********************************************************************
26    ///
27    /// See also [Apple's documentation](https://developer.apple.com/documentation/opengles/keaglcolorformatrgba8?language=objc)
28    pub static kEAGLColorFormatRGBA8: &'static NSString;
29}
30
31extern "C" {
32    /// [Apple's documentation](https://developer.apple.com/documentation/opengles/keaglcolorformatrgb565?language=objc)
33    pub static kEAGLColorFormatRGB565: &'static NSString;
34}
35
36extern "C" {
37    /// [Apple's documentation](https://developer.apple.com/documentation/opengles/keaglcolorformatsrgba8?language=objc)
38    pub static kEAGLColorFormatSRGBA8: &'static NSString;
39}
40
41extern_protocol!(
42    /// *********************************************************************
43    ///
44    /// See also [Apple's documentation](https://developer.apple.com/documentation/opengles/eagldrawable?language=objc)
45    pub unsafe trait EAGLDrawable {
46        #[unsafe(method(drawableProperties))]
47        #[unsafe(method_family = none)]
48        unsafe fn drawableProperties(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
49
50        /// Setter for [`drawableProperties`][Self::drawableProperties].
51        ///
52        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
53        ///
54        /// # Safety
55        ///
56        /// `drawable_properties` generic should be of the correct type.
57        #[unsafe(method(setDrawableProperties:))]
58        #[unsafe(method_family = none)]
59        unsafe fn setDrawableProperties(
60            &self,
61            drawable_properties: Option<&NSDictionary<NSString, AnyObject>>,
62        );
63    }
64);
65
66/// EAGLContextDrawableAdditions.
67#[cfg(feature = "EAGL")]
68impl EAGLContext {
69    extern_methods!(
70        #[unsafe(method(renderbufferStorage:fromDrawable:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn renderbufferStorage_fromDrawable(
73            &self,
74            target: NSUInteger,
75            drawable: Option<&ProtocolObject<dyn EAGLDrawable>>,
76        ) -> bool;
77
78        #[unsafe(method(presentRenderbuffer:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn presentRenderbuffer(&self, target: NSUInteger) -> bool;
81
82        #[cfg(feature = "objc2-core-foundation")]
83        #[unsafe(method(presentRenderbuffer:atTime:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn presentRenderbuffer_atTime(
86            &self,
87            target: NSUInteger,
88            presentation_time: CFTimeInterval,
89        ) -> bool;
90
91        #[cfg(feature = "objc2-core-foundation")]
92        #[unsafe(method(presentRenderbuffer:afterMinimumDuration:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn presentRenderbuffer_afterMinimumDuration(
95            &self,
96            target: NSUInteger,
97            duration: CFTimeInterval,
98        ) -> bool;
99    );
100}