objc2_gl_kit/generated/
GLKModel.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6#[cfg(feature = "objc2-model-io")]
7use objc2_model_io::*;
8#[cfg(feature = "objc2-open-gl")]
9#[cfg(target_os = "macos")]
10use objc2_open_gl::*;
11
12use crate::*;
13
14extern "C" {
15 pub static kGLKModelErrorDomain: &'static NSString;
17}
18
19extern "C" {
20 pub static kGLKModelErrorKey: &'static NSString;
22}
23
24extern_class!(
25 #[unsafe(super(NSObject))]
29 #[derive(Debug, PartialEq, Eq, Hash)]
30 pub struct GLKMeshBufferAllocator;
31);
32
33#[cfg(feature = "objc2-model-io")]
34extern_conformance!(
35 unsafe impl MDLMeshBufferAllocator for GLKMeshBufferAllocator {}
36);
37
38extern_conformance!(
39 unsafe impl NSObjectProtocol for GLKMeshBufferAllocator {}
40);
41
42impl GLKMeshBufferAllocator {
43 extern_methods!();
44}
45
46impl GLKMeshBufferAllocator {
48 extern_methods!(
49 #[unsafe(method(init))]
50 #[unsafe(method_family = init)]
51 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
52
53 #[unsafe(method(new))]
54 #[unsafe(method_family = new)]
55 pub unsafe fn new() -> Retained<Self>;
56 );
57}
58
59extern_class!(
60 #[unsafe(super(NSObject))]
66 #[derive(Debug, PartialEq, Eq, Hash)]
67 pub struct GLKMeshBuffer;
68);
69
70#[cfg(feature = "objc2-model-io")]
71extern_conformance!(
72 unsafe impl MDLMeshBuffer for GLKMeshBuffer {}
73);
74
75extern_conformance!(
76 unsafe impl NSCopying for GLKMeshBuffer {}
77);
78
79unsafe impl CopyingHelper for GLKMeshBuffer {
80 type Result = Self;
81}
82
83extern_conformance!(
84 unsafe impl NSObjectProtocol for GLKMeshBuffer {}
85);
86
87impl GLKMeshBuffer {
88 extern_methods!(
89 #[unsafe(method(length))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn length(&self) -> NSUInteger;
93
94 #[unsafe(method(allocator))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn allocator(&self) -> Retained<GLKMeshBufferAllocator>;
100
101 #[cfg(feature = "objc2-open-gl")]
102 #[cfg(target_os = "macos")]
103 #[unsafe(method(glBufferName))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn glBufferName(&self) -> GLuint;
109
110 #[unsafe(method(offset))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn offset(&self) -> NSUInteger;
114
115 #[cfg(feature = "objc2-model-io")]
116 #[unsafe(method(zone))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn zone(&self) -> Option<Retained<ProtocolObject<dyn MDLMeshBufferZone>>>;
122
123 #[cfg(feature = "objc2-model-io")]
124 #[unsafe(method(type))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn r#type(&self) -> MDLMeshBufferType;
128 );
129}
130
131impl GLKMeshBuffer {
133 extern_methods!(
134 #[unsafe(method(init))]
135 #[unsafe(method_family = init)]
136 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
137
138 #[unsafe(method(new))]
139 #[unsafe(method_family = new)]
140 pub unsafe fn new() -> Retained<Self>;
141 );
142}
143
144extern_class!(
145 #[unsafe(super(NSObject))]
147 #[derive(Debug, PartialEq, Eq, Hash)]
148 pub struct GLKSubmesh;
149);
150
151extern_conformance!(
152 unsafe impl NSObjectProtocol for GLKSubmesh {}
153);
154
155impl GLKSubmesh {
156 extern_methods!(
157 #[unsafe(method(init))]
159 #[unsafe(method_family = init)]
160 pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
161
162 #[cfg(feature = "objc2-open-gl")]
163 #[cfg(target_os = "macos")]
164 #[unsafe(method(type))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn r#type(&self) -> GLenum;
170
171 #[cfg(feature = "objc2-open-gl")]
172 #[cfg(target_os = "macos")]
173 #[unsafe(method(mode))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn mode(&self) -> GLenum;
179
180 #[cfg(feature = "objc2-open-gl")]
181 #[cfg(target_os = "macos")]
182 #[unsafe(method(elementCount))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn elementCount(&self) -> GLsizei;
188
189 #[unsafe(method(elementBuffer))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn elementBuffer(&self) -> Retained<GLKMeshBuffer>;
195
196 #[unsafe(method(mesh))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn mesh(&self) -> Option<Retained<GLKMesh>>;
202
203 #[unsafe(method(name))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn name(&self) -> Retained<NSString>;
209 );
210}
211
212impl GLKSubmesh {
214 extern_methods!(
215 #[unsafe(method(new))]
216 #[unsafe(method_family = new)]
217 pub unsafe fn new() -> Retained<Self>;
218 );
219}
220
221extern_class!(
222 #[unsafe(super(NSObject))]
224 #[derive(Debug, PartialEq, Eq, Hash)]
225 pub struct GLKMesh;
226);
227
228extern_conformance!(
229 unsafe impl NSObjectProtocol for GLKMesh {}
230);
231
232impl GLKMesh {
233 extern_methods!(
234 #[unsafe(method(init))]
236 #[unsafe(method_family = init)]
237 pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
238
239 #[cfg(feature = "objc2-model-io")]
240 #[unsafe(method(initWithMesh:error:_))]
247 #[unsafe(method_family = init)]
248 pub unsafe fn initWithMesh_error(
249 this: Allocated<Self>,
250 mesh: &MDLMesh,
251 ) -> Result<Retained<Self>, Retained<NSError>>;
252
253 #[cfg(feature = "objc2-model-io")]
254 #[unsafe(method(newMeshesFromAsset:sourceMeshes:error:_))]
268 #[unsafe(method_family = new)]
269 pub unsafe fn newMeshesFromAsset_sourceMeshes_error(
270 asset: &MDLAsset,
271 source_meshes: Option<&mut Option<Retained<NSArray<MDLMesh>>>>,
272 ) -> Result<Retained<NSArray<GLKMesh>>, Retained<NSError>>;
273
274 #[unsafe(method(vertexCount))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn vertexCount(&self) -> NSUInteger;
278
279 #[unsafe(method(vertexBuffers))]
281 #[unsafe(method_family = none)]
282 pub unsafe fn vertexBuffers(&self) -> Retained<NSArray<GLKMeshBuffer>>;
283
284 #[cfg(feature = "objc2-model-io")]
285 #[unsafe(method(vertexDescriptor))]
289 #[unsafe(method_family = none)]
290 pub unsafe fn vertexDescriptor(&self) -> Retained<MDLVertexDescriptor>;
291
292 #[unsafe(method(submeshes))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn submeshes(&self) -> Retained<NSArray<GLKSubmesh>>;
298
299 #[unsafe(method(name))]
303 #[unsafe(method_family = none)]
304 pub unsafe fn name(&self) -> Retained<NSString>;
305 );
306}
307
308impl GLKMesh {
310 extern_methods!(
311 #[unsafe(method(new))]
312 #[unsafe(method_family = new)]
313 pub unsafe fn new() -> Retained<Self>;
314 );
315}
316
317#[cfg(feature = "objc2-open-gl")]
321#[cfg(target_os = "macos")]
322#[repr(C)]
323#[derive(Clone, Copy, Debug, PartialEq)]
324pub struct GLKVertexAttributeParameters {
325 pub r#type: GLenum,
326 pub size: GLint,
327 pub normalized: GLboolean,
328}
329
330#[cfg(feature = "objc2-open-gl")]
331#[cfg(target_os = "macos")]
332unsafe impl Encode for GLKVertexAttributeParameters {
333 const ENCODING: Encoding = Encoding::Struct(
334 "_GLKVertexAttributeParameters",
335 &[<GLenum>::ENCODING, <GLint>::ENCODING, <GLboolean>::ENCODING],
336 );
337}
338
339#[cfg(feature = "objc2-open-gl")]
340#[cfg(target_os = "macos")]
341unsafe impl RefEncode for GLKVertexAttributeParameters {
342 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
343}
344
345extern "C-unwind" {
346 #[cfg(all(feature = "objc2-model-io", feature = "objc2-open-gl"))]
348 #[cfg(target_os = "macos")]
349 pub fn GLKVertexAttributeParametersFromModelIO(
350 vertex_format: MDLVertexFormat,
351 ) -> GLKVertexAttributeParameters;
352}