objc2_open_gl_es/generated/
EAGL.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10pub const EAGL_MAJOR_VERSION: c_uint = 1;
12pub const EAGL_MINOR_VERSION: c_uint = 0;
14#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct EAGLRenderingAPI(pub NSUInteger);
21impl EAGLRenderingAPI {
22 #[doc(alias = "kEAGLRenderingAPIOpenGLES1")]
23 pub const OpenGLES1: Self = Self(1);
24 #[doc(alias = "kEAGLRenderingAPIOpenGLES2")]
25 pub const OpenGLES2: Self = Self(2);
26 #[doc(alias = "kEAGLRenderingAPIOpenGLES3")]
27 pub const OpenGLES3: Self = Self(3);
28}
29
30unsafe impl Encode for EAGLRenderingAPI {
31 const ENCODING: Encoding = NSUInteger::ENCODING;
32}
33
34unsafe impl RefEncode for EAGLRenderingAPI {
35 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38extern "C-unwind" {
39 pub fn EAGLGetVersion(major: NonNull<c_uint>, minor: NonNull<c_uint>);
46}
47
48extern_class!(
49 #[unsafe(super(NSObject))]
53 #[derive(Debug, PartialEq, Eq, Hash)]
54 pub struct EAGLSharegroup;
55);
56
57extern_conformance!(
58 unsafe impl NSObjectProtocol for EAGLSharegroup {}
59);
60
61impl EAGLSharegroup {
62 extern_methods!(
63 #[unsafe(method(debugLabel))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn debugLabel(&self) -> Option<Retained<NSString>>;
66
67 #[unsafe(method(setDebugLabel:))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn setDebugLabel(&self, debug_label: Option<&NSString>);
73 );
74}
75
76impl EAGLSharegroup {
78 extern_methods!(
79 #[unsafe(method(init))]
80 #[unsafe(method_family = init)]
81 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83 #[unsafe(method(new))]
84 #[unsafe(method_family = new)]
85 pub unsafe fn new() -> Retained<Self>;
86 );
87}
88
89extern_class!(
90 #[unsafe(super(NSObject))]
94 #[derive(Debug, PartialEq, Eq, Hash)]
95 pub struct EAGLContext;
96);
97
98extern_conformance!(
99 unsafe impl NSObjectProtocol for EAGLContext {}
100);
101
102impl EAGLContext {
103 extern_methods!(
104 #[unsafe(method(init))]
105 #[unsafe(method_family = init)]
106 pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
107
108 #[unsafe(method(initWithAPI:))]
109 #[unsafe(method_family = init)]
110 pub unsafe fn initWithAPI(
111 this: Allocated<Self>,
112 api: EAGLRenderingAPI,
113 ) -> Option<Retained<Self>>;
114
115 #[unsafe(method(initWithAPI:sharegroup:))]
116 #[unsafe(method_family = init)]
117 pub unsafe fn initWithAPI_sharegroup(
118 this: Allocated<Self>,
119 api: EAGLRenderingAPI,
120 sharegroup: &EAGLSharegroup,
121 ) -> Option<Retained<Self>>;
122
123 #[unsafe(method(setCurrentContext:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setCurrentContext(context: Option<&EAGLContext>) -> bool;
126
127 #[unsafe(method(currentContext))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn currentContext() -> Option<Retained<EAGLContext>>;
130
131 #[unsafe(method(API))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn API(&self) -> EAGLRenderingAPI;
134
135 #[unsafe(method(sharegroup))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn sharegroup(&self) -> Retained<EAGLSharegroup>;
138
139 #[unsafe(method(debugLabel))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn debugLabel(&self) -> Option<Retained<NSString>>;
142
143 #[unsafe(method(setDebugLabel:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn setDebugLabel(&self, debug_label: Option<&NSString>);
149
150 #[unsafe(method(isMultiThreaded))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn isMultiThreaded(&self) -> bool;
153
154 #[unsafe(method(setMultiThreaded:))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn setMultiThreaded(&self, multi_threaded: bool);
158 );
159}
160
161impl EAGLContext {
163 extern_methods!(
164 #[unsafe(method(new))]
165 #[unsafe(method_family = new)]
166 pub unsafe fn new() -> Retained<Self>;
167 );
168}