objc2_model_io/generated/
MDLVertexDescriptor.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11 pub static MDLVertexAttributeAnisotropy: &'static NSString;
16}
17
18extern "C" {
19 pub static MDLVertexAttributeBinormal: &'static NSString;
23}
24
25extern "C" {
26 pub static MDLVertexAttributeBitangent: &'static NSString;
30}
31
32extern "C" {
33 pub static MDLVertexAttributeColor: &'static NSString;
37}
38
39extern "C" {
40 pub static MDLVertexAttributeEdgeCrease: &'static NSString;
45}
46
47extern "C" {
48 pub static MDLVertexAttributeJointIndices: &'static NSString;
52}
53
54extern "C" {
55 pub static MDLVertexAttributeJointWeights: &'static NSString;
59}
60
61extern "C" {
62 pub static MDLVertexAttributeNormal: &'static NSString;
66}
67
68extern "C" {
69 pub static MDLVertexAttributeOcclusionValue: &'static NSString;
73}
74
75extern "C" {
76 pub static MDLVertexAttributePosition: &'static NSString;
80}
81
82extern "C" {
83 pub static MDLVertexAttributeShadingBasisU: &'static NSString;
87}
88
89extern "C" {
90 pub static MDLVertexAttributeShadingBasisV: &'static NSString;
94}
95
96extern "C" {
97 pub static MDLVertexAttributeSubdivisionStencil: &'static NSString;
101}
102
103extern "C" {
104 pub static MDLVertexAttributeTangent: &'static NSString;
108}
109
110extern "C" {
111 pub static MDLVertexAttributeTextureCoordinate: &'static NSString;
115}
116
117#[repr(transparent)]
128#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
129pub struct MDLVertexFormat(pub NSUInteger);
130impl MDLVertexFormat {
131 #[doc(alias = "MDLVertexFormatInvalid")]
132 pub const Invalid: Self = Self(0);
133 #[doc(alias = "MDLVertexFormatPackedBit")]
134 pub const PackedBit: Self = Self(0x1000);
135 #[doc(alias = "MDLVertexFormatUCharBits")]
136 pub const UCharBits: Self = Self(0x10000);
137 #[doc(alias = "MDLVertexFormatCharBits")]
138 pub const CharBits: Self = Self(0x20000);
139 #[doc(alias = "MDLVertexFormatUCharNormalizedBits")]
140 pub const UCharNormalizedBits: Self = Self(0x30000);
141 #[doc(alias = "MDLVertexFormatCharNormalizedBits")]
142 pub const CharNormalizedBits: Self = Self(0x40000);
143 #[doc(alias = "MDLVertexFormatUShortBits")]
144 pub const UShortBits: Self = Self(0x50000);
145 #[doc(alias = "MDLVertexFormatShortBits")]
146 pub const ShortBits: Self = Self(0x60000);
147 #[doc(alias = "MDLVertexFormatUShortNormalizedBits")]
148 pub const UShortNormalizedBits: Self = Self(0x70000);
149 #[doc(alias = "MDLVertexFormatShortNormalizedBits")]
150 pub const ShortNormalizedBits: Self = Self(0x80000);
151 #[doc(alias = "MDLVertexFormatUIntBits")]
152 pub const UIntBits: Self = Self(0x90000);
153 #[doc(alias = "MDLVertexFormatIntBits")]
154 pub const IntBits: Self = Self(0xA0000);
155 #[doc(alias = "MDLVertexFormatHalfBits")]
156 pub const HalfBits: Self = Self(0xB0000);
157 #[doc(alias = "MDLVertexFormatFloatBits")]
158 pub const FloatBits: Self = Self(0xC0000);
159 #[doc(alias = "MDLVertexFormatUChar")]
160 pub const UChar: Self = Self(MDLVertexFormat::UCharBits.0 | 1);
161 #[doc(alias = "MDLVertexFormatUChar2")]
162 pub const UChar2: Self = Self(MDLVertexFormat::UCharBits.0 | 2);
163 #[doc(alias = "MDLVertexFormatUChar3")]
164 pub const UChar3: Self = Self(MDLVertexFormat::UCharBits.0 | 3);
165 #[doc(alias = "MDLVertexFormatUChar4")]
166 pub const UChar4: Self = Self(MDLVertexFormat::UCharBits.0 | 4);
167 #[doc(alias = "MDLVertexFormatChar")]
168 pub const Char: Self = Self(MDLVertexFormat::CharBits.0 | 1);
169 #[doc(alias = "MDLVertexFormatChar2")]
170 pub const Char2: Self = Self(MDLVertexFormat::CharBits.0 | 2);
171 #[doc(alias = "MDLVertexFormatChar3")]
172 pub const Char3: Self = Self(MDLVertexFormat::CharBits.0 | 3);
173 #[doc(alias = "MDLVertexFormatChar4")]
174 pub const Char4: Self = Self(MDLVertexFormat::CharBits.0 | 4);
175 #[doc(alias = "MDLVertexFormatUCharNormalized")]
176 pub const UCharNormalized: Self = Self(MDLVertexFormat::UCharNormalizedBits.0 | 1);
177 #[doc(alias = "MDLVertexFormatUChar2Normalized")]
178 pub const UChar2Normalized: Self = Self(MDLVertexFormat::UCharNormalizedBits.0 | 2);
179 #[doc(alias = "MDLVertexFormatUChar3Normalized")]
180 pub const UChar3Normalized: Self = Self(MDLVertexFormat::UCharNormalizedBits.0 | 3);
181 #[doc(alias = "MDLVertexFormatUChar4Normalized")]
182 pub const UChar4Normalized: Self = Self(MDLVertexFormat::UCharNormalizedBits.0 | 4);
183 #[doc(alias = "MDLVertexFormatCharNormalized")]
184 pub const CharNormalized: Self = Self(MDLVertexFormat::CharNormalizedBits.0 | 1);
185 #[doc(alias = "MDLVertexFormatChar2Normalized")]
186 pub const Char2Normalized: Self = Self(MDLVertexFormat::CharNormalizedBits.0 | 2);
187 #[doc(alias = "MDLVertexFormatChar3Normalized")]
188 pub const Char3Normalized: Self = Self(MDLVertexFormat::CharNormalizedBits.0 | 3);
189 #[doc(alias = "MDLVertexFormatChar4Normalized")]
190 pub const Char4Normalized: Self = Self(MDLVertexFormat::CharNormalizedBits.0 | 4);
191 #[doc(alias = "MDLVertexFormatUShort")]
192 pub const UShort: Self = Self(MDLVertexFormat::UShortBits.0 | 1);
193 #[doc(alias = "MDLVertexFormatUShort2")]
194 pub const UShort2: Self = Self(MDLVertexFormat::UShortBits.0 | 2);
195 #[doc(alias = "MDLVertexFormatUShort3")]
196 pub const UShort3: Self = Self(MDLVertexFormat::UShortBits.0 | 3);
197 #[doc(alias = "MDLVertexFormatUShort4")]
198 pub const UShort4: Self = Self(MDLVertexFormat::UShortBits.0 | 4);
199 #[doc(alias = "MDLVertexFormatShort")]
200 pub const Short: Self = Self(MDLVertexFormat::ShortBits.0 | 1);
201 #[doc(alias = "MDLVertexFormatShort2")]
202 pub const Short2: Self = Self(MDLVertexFormat::ShortBits.0 | 2);
203 #[doc(alias = "MDLVertexFormatShort3")]
204 pub const Short3: Self = Self(MDLVertexFormat::ShortBits.0 | 3);
205 #[doc(alias = "MDLVertexFormatShort4")]
206 pub const Short4: Self = Self(MDLVertexFormat::ShortBits.0 | 4);
207 #[doc(alias = "MDLVertexFormatUShortNormalized")]
208 pub const UShortNormalized: Self = Self(MDLVertexFormat::UShortNormalizedBits.0 | 1);
209 #[doc(alias = "MDLVertexFormatUShort2Normalized")]
210 pub const UShort2Normalized: Self = Self(MDLVertexFormat::UShortNormalizedBits.0 | 2);
211 #[doc(alias = "MDLVertexFormatUShort3Normalized")]
212 pub const UShort3Normalized: Self = Self(MDLVertexFormat::UShortNormalizedBits.0 | 3);
213 #[doc(alias = "MDLVertexFormatUShort4Normalized")]
214 pub const UShort4Normalized: Self = Self(MDLVertexFormat::UShortNormalizedBits.0 | 4);
215 #[doc(alias = "MDLVertexFormatShortNormalized")]
216 pub const ShortNormalized: Self = Self(MDLVertexFormat::ShortNormalizedBits.0 | 1);
217 #[doc(alias = "MDLVertexFormatShort2Normalized")]
218 pub const Short2Normalized: Self = Self(MDLVertexFormat::ShortNormalizedBits.0 | 2);
219 #[doc(alias = "MDLVertexFormatShort3Normalized")]
220 pub const Short3Normalized: Self = Self(MDLVertexFormat::ShortNormalizedBits.0 | 3);
221 #[doc(alias = "MDLVertexFormatShort4Normalized")]
222 pub const Short4Normalized: Self = Self(MDLVertexFormat::ShortNormalizedBits.0 | 4);
223 #[doc(alias = "MDLVertexFormatUInt")]
224 pub const UInt: Self = Self(MDLVertexFormat::UIntBits.0 | 1);
225 #[doc(alias = "MDLVertexFormatUInt2")]
226 pub const UInt2: Self = Self(MDLVertexFormat::UIntBits.0 | 2);
227 #[doc(alias = "MDLVertexFormatUInt3")]
228 pub const UInt3: Self = Self(MDLVertexFormat::UIntBits.0 | 3);
229 #[doc(alias = "MDLVertexFormatUInt4")]
230 pub const UInt4: Self = Self(MDLVertexFormat::UIntBits.0 | 4);
231 #[doc(alias = "MDLVertexFormatInt")]
232 pub const Int: Self = Self(MDLVertexFormat::IntBits.0 | 1);
233 #[doc(alias = "MDLVertexFormatInt2")]
234 pub const Int2: Self = Self(MDLVertexFormat::IntBits.0 | 2);
235 #[doc(alias = "MDLVertexFormatInt3")]
236 pub const Int3: Self = Self(MDLVertexFormat::IntBits.0 | 3);
237 #[doc(alias = "MDLVertexFormatInt4")]
238 pub const Int4: Self = Self(MDLVertexFormat::IntBits.0 | 4);
239 #[doc(alias = "MDLVertexFormatHalf")]
240 pub const Half: Self = Self(MDLVertexFormat::HalfBits.0 | 1);
241 #[doc(alias = "MDLVertexFormatHalf2")]
242 pub const Half2: Self = Self(MDLVertexFormat::HalfBits.0 | 2);
243 #[doc(alias = "MDLVertexFormatHalf3")]
244 pub const Half3: Self = Self(MDLVertexFormat::HalfBits.0 | 3);
245 #[doc(alias = "MDLVertexFormatHalf4")]
246 pub const Half4: Self = Self(MDLVertexFormat::HalfBits.0 | 4);
247 #[doc(alias = "MDLVertexFormatFloat")]
248 pub const Float: Self = Self(MDLVertexFormat::FloatBits.0 | 1);
249 #[doc(alias = "MDLVertexFormatFloat2")]
250 pub const Float2: Self = Self(MDLVertexFormat::FloatBits.0 | 2);
251 #[doc(alias = "MDLVertexFormatFloat3")]
252 pub const Float3: Self = Self(MDLVertexFormat::FloatBits.0 | 3);
253 #[doc(alias = "MDLVertexFormatFloat4")]
254 pub const Float4: Self = Self(MDLVertexFormat::FloatBits.0 | 4);
255 #[doc(alias = "MDLVertexFormatInt1010102Normalized")]
256 pub const Int1010102Normalized: Self =
257 Self(MDLVertexFormat::IntBits.0 | MDLVertexFormat::PackedBit.0 | 4);
258 #[doc(alias = "MDLVertexFormatUInt1010102Normalized")]
259 pub const UInt1010102Normalized: Self =
260 Self(MDLVertexFormat::UIntBits.0 | MDLVertexFormat::PackedBit.0 | 4);
261}
262
263unsafe impl Encode for MDLVertexFormat {
264 const ENCODING: Encoding = NSUInteger::ENCODING;
265}
266
267unsafe impl RefEncode for MDLVertexFormat {
268 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
269}
270
271extern_class!(
272 #[unsafe(super(NSObject))]
276 #[derive(Debug, PartialEq, Eq, Hash)]
277 pub struct MDLVertexBufferLayout;
278);
279
280extern_conformance!(
281 unsafe impl NSCopying for MDLVertexBufferLayout {}
282);
283
284unsafe impl CopyingHelper for MDLVertexBufferLayout {
285 type Result = Self;
286}
287
288extern_conformance!(
289 unsafe impl NSObjectProtocol for MDLVertexBufferLayout {}
290);
291
292impl MDLVertexBufferLayout {
293 extern_methods!(
294 #[unsafe(method(initWithStride:))]
295 #[unsafe(method_family = init)]
296 pub unsafe fn initWithStride(this: Allocated<Self>, stride: NSUInteger) -> Retained<Self>;
297
298 #[unsafe(method(stride))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn stride(&self) -> NSUInteger;
308
309 #[unsafe(method(setStride:))]
311 #[unsafe(method_family = none)]
312 pub unsafe fn setStride(&self, stride: NSUInteger);
313 );
314}
315
316impl MDLVertexBufferLayout {
318 extern_methods!(
319 #[unsafe(method(init))]
320 #[unsafe(method_family = init)]
321 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
322
323 #[unsafe(method(new))]
324 #[unsafe(method_family = new)]
325 pub unsafe fn new() -> Retained<Self>;
326 );
327}
328
329extern_class!(
330 #[unsafe(super(NSObject))]
334 #[derive(Debug, PartialEq, Eq, Hash)]
335 pub struct MDLVertexAttribute;
336);
337
338extern_conformance!(
339 unsafe impl NSCopying for MDLVertexAttribute {}
340);
341
342unsafe impl CopyingHelper for MDLVertexAttribute {
343 type Result = Self;
344}
345
346extern_conformance!(
347 unsafe impl NSObjectProtocol for MDLVertexAttribute {}
348);
349
350impl MDLVertexAttribute {
351 extern_methods!(
352 #[unsafe(method(initWithName:format:offset:bufferIndex:))]
354 #[unsafe(method_family = init)]
355 pub unsafe fn initWithName_format_offset_bufferIndex(
356 this: Allocated<Self>,
357 name: &NSString,
358 format: MDLVertexFormat,
359 offset: NSUInteger,
360 buffer_index: NSUInteger,
361 ) -> Retained<Self>;
362
363 #[unsafe(method(name))]
366 #[unsafe(method_family = none)]
367 pub unsafe fn name(&self) -> Retained<NSString>;
368
369 #[unsafe(method(setName:))]
373 #[unsafe(method_family = none)]
374 pub unsafe fn setName(&self, name: &NSString);
375
376 #[unsafe(method(format))]
382 #[unsafe(method_family = none)]
383 pub unsafe fn format(&self) -> MDLVertexFormat;
384
385 #[unsafe(method(setFormat:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn setFormat(&self, format: MDLVertexFormat);
389
390 #[unsafe(method(offset))]
392 #[unsafe(method_family = none)]
393 pub unsafe fn offset(&self) -> NSUInteger;
394
395 #[unsafe(method(setOffset:))]
397 #[unsafe(method_family = none)]
398 pub unsafe fn setOffset(&self, offset: NSUInteger);
399
400 #[unsafe(method(bufferIndex))]
403 #[unsafe(method_family = none)]
404 pub unsafe fn bufferIndex(&self) -> NSUInteger;
405
406 #[unsafe(method(setBufferIndex:))]
408 #[unsafe(method_family = none)]
409 pub unsafe fn setBufferIndex(&self, buffer_index: NSUInteger);
410
411 #[unsafe(method(time))]
415 #[unsafe(method_family = none)]
416 pub unsafe fn time(&self) -> NSTimeInterval;
417
418 #[unsafe(method(setTime:))]
420 #[unsafe(method_family = none)]
421 pub unsafe fn setTime(&self, time: NSTimeInterval);
422 );
423}
424
425impl MDLVertexAttribute {
427 extern_methods!(
428 #[unsafe(method(init))]
429 #[unsafe(method_family = init)]
430 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
431
432 #[unsafe(method(new))]
433 #[unsafe(method_family = new)]
434 pub unsafe fn new() -> Retained<Self>;
435 );
436}
437
438extern_class!(
439 #[unsafe(super(NSObject))]
451 #[derive(Debug, PartialEq, Eq, Hash)]
452 pub struct MDLVertexDescriptor;
453);
454
455extern_conformance!(
456 unsafe impl NSCopying for MDLVertexDescriptor {}
457);
458
459unsafe impl CopyingHelper for MDLVertexDescriptor {
460 type Result = Self;
461}
462
463extern_conformance!(
464 unsafe impl NSObjectProtocol for MDLVertexDescriptor {}
465);
466
467impl MDLVertexDescriptor {
468 extern_methods!(
469 #[unsafe(method(initWithVertexDescriptor:))]
473 #[unsafe(method_family = init)]
474 pub unsafe fn initWithVertexDescriptor(
475 this: Allocated<Self>,
476 vertex_descriptor: &MDLVertexDescriptor,
477 ) -> Retained<Self>;
478
479 #[unsafe(method(attributeNamed:))]
484 #[unsafe(method_family = none)]
485 pub unsafe fn attributeNamed(
486 &self,
487 name: &NSString,
488 ) -> Option<Retained<MDLVertexAttribute>>;
489
490 #[unsafe(method(addOrReplaceAttribute:))]
493 #[unsafe(method_family = none)]
494 pub unsafe fn addOrReplaceAttribute(&self, attribute: &MDLVertexAttribute);
495
496 #[unsafe(method(removeAttributeNamed:))]
498 #[unsafe(method_family = none)]
499 pub unsafe fn removeAttributeNamed(&self, name: &NSString);
500
501 #[unsafe(method(attributes))]
506 #[unsafe(method_family = none)]
507 pub unsafe fn attributes(&self) -> Retained<NSMutableArray<MDLVertexAttribute>>;
508
509 #[unsafe(method(setAttributes:))]
511 #[unsafe(method_family = none)]
512 pub unsafe fn setAttributes(&self, attributes: &NSMutableArray<MDLVertexAttribute>);
513
514 #[unsafe(method(layouts))]
519 #[unsafe(method_family = none)]
520 pub unsafe fn layouts(&self) -> Retained<NSMutableArray<MDLVertexBufferLayout>>;
521
522 #[unsafe(method(setLayouts:))]
524 #[unsafe(method_family = none)]
525 pub unsafe fn setLayouts(&self, layouts: &NSMutableArray<MDLVertexBufferLayout>);
526
527 #[unsafe(method(reset))]
529 #[unsafe(method_family = none)]
530 pub unsafe fn reset(&self);
531
532 #[unsafe(method(setPackedStrides))]
535 #[unsafe(method_family = none)]
536 pub unsafe fn setPackedStrides(&self);
537
538 #[unsafe(method(setPackedOffsets))]
542 #[unsafe(method_family = none)]
543 pub unsafe fn setPackedOffsets(&self);
544 );
545}
546
547impl MDLVertexDescriptor {
549 extern_methods!(
550 #[unsafe(method(init))]
551 #[unsafe(method_family = init)]
552 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
553
554 #[unsafe(method(new))]
555 #[unsafe(method_family = new)]
556 pub unsafe fn new() -> Retained<Self>;
557 );
558}