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
280unsafe impl NSCopying for MDLVertexBufferLayout {}
281
282unsafe impl CopyingHelper for MDLVertexBufferLayout {
283 type Result = Self;
284}
285
286unsafe impl NSObjectProtocol for MDLVertexBufferLayout {}
287
288impl MDLVertexBufferLayout {
289 extern_methods!(
290 #[unsafe(method(initWithStride:))]
291 #[unsafe(method_family = init)]
292 pub unsafe fn initWithStride(this: Allocated<Self>, stride: NSUInteger) -> Retained<Self>;
293
294 #[unsafe(method(stride))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn stride(&self) -> NSUInteger;
304
305 #[unsafe(method(setStride:))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn setStride(&self, stride: NSUInteger);
309 );
310}
311
312impl MDLVertexBufferLayout {
314 extern_methods!(
315 #[unsafe(method(init))]
316 #[unsafe(method_family = init)]
317 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
318
319 #[unsafe(method(new))]
320 #[unsafe(method_family = new)]
321 pub unsafe fn new() -> Retained<Self>;
322 );
323}
324
325extern_class!(
326 #[unsafe(super(NSObject))]
330 #[derive(Debug, PartialEq, Eq, Hash)]
331 pub struct MDLVertexAttribute;
332);
333
334unsafe impl NSCopying for MDLVertexAttribute {}
335
336unsafe impl CopyingHelper for MDLVertexAttribute {
337 type Result = Self;
338}
339
340unsafe impl NSObjectProtocol for MDLVertexAttribute {}
341
342impl MDLVertexAttribute {
343 extern_methods!(
344 #[unsafe(method(initWithName:format:offset:bufferIndex:))]
346 #[unsafe(method_family = init)]
347 pub unsafe fn initWithName_format_offset_bufferIndex(
348 this: Allocated<Self>,
349 name: &NSString,
350 format: MDLVertexFormat,
351 offset: NSUInteger,
352 buffer_index: NSUInteger,
353 ) -> Retained<Self>;
354
355 #[unsafe(method(name))]
358 #[unsafe(method_family = none)]
359 pub unsafe fn name(&self) -> Retained<NSString>;
360
361 #[unsafe(method(setName:))]
363 #[unsafe(method_family = none)]
364 pub unsafe fn setName(&self, name: &NSString);
365
366 #[unsafe(method(format))]
372 #[unsafe(method_family = none)]
373 pub unsafe fn format(&self) -> MDLVertexFormat;
374
375 #[unsafe(method(setFormat:))]
377 #[unsafe(method_family = none)]
378 pub unsafe fn setFormat(&self, format: MDLVertexFormat);
379
380 #[unsafe(method(offset))]
382 #[unsafe(method_family = none)]
383 pub unsafe fn offset(&self) -> NSUInteger;
384
385 #[unsafe(method(setOffset:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn setOffset(&self, offset: NSUInteger);
389
390 #[unsafe(method(bufferIndex))]
393 #[unsafe(method_family = none)]
394 pub unsafe fn bufferIndex(&self) -> NSUInteger;
395
396 #[unsafe(method(setBufferIndex:))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn setBufferIndex(&self, buffer_index: NSUInteger);
400
401 #[unsafe(method(time))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn time(&self) -> NSTimeInterval;
407
408 #[unsafe(method(setTime:))]
410 #[unsafe(method_family = none)]
411 pub unsafe fn setTime(&self, time: NSTimeInterval);
412 );
413}
414
415impl MDLVertexAttribute {
417 extern_methods!(
418 #[unsafe(method(init))]
419 #[unsafe(method_family = init)]
420 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
421
422 #[unsafe(method(new))]
423 #[unsafe(method_family = new)]
424 pub unsafe fn new() -> Retained<Self>;
425 );
426}
427
428extern_class!(
429 #[unsafe(super(NSObject))]
441 #[derive(Debug, PartialEq, Eq, Hash)]
442 pub struct MDLVertexDescriptor;
443);
444
445unsafe impl NSCopying for MDLVertexDescriptor {}
446
447unsafe impl CopyingHelper for MDLVertexDescriptor {
448 type Result = Self;
449}
450
451unsafe impl NSObjectProtocol for MDLVertexDescriptor {}
452
453impl MDLVertexDescriptor {
454 extern_methods!(
455 #[unsafe(method(initWithVertexDescriptor:))]
459 #[unsafe(method_family = init)]
460 pub unsafe fn initWithVertexDescriptor(
461 this: Allocated<Self>,
462 vertex_descriptor: &MDLVertexDescriptor,
463 ) -> Retained<Self>;
464
465 #[unsafe(method(attributeNamed:))]
470 #[unsafe(method_family = none)]
471 pub unsafe fn attributeNamed(
472 &self,
473 name: &NSString,
474 ) -> Option<Retained<MDLVertexAttribute>>;
475
476 #[unsafe(method(addOrReplaceAttribute:))]
479 #[unsafe(method_family = none)]
480 pub unsafe fn addOrReplaceAttribute(&self, attribute: &MDLVertexAttribute);
481
482 #[unsafe(method(removeAttributeNamed:))]
484 #[unsafe(method_family = none)]
485 pub unsafe fn removeAttributeNamed(&self, name: &NSString);
486
487 #[unsafe(method(attributes))]
492 #[unsafe(method_family = none)]
493 pub unsafe fn attributes(&self) -> Retained<NSMutableArray<MDLVertexAttribute>>;
494
495 #[unsafe(method(setAttributes:))]
497 #[unsafe(method_family = none)]
498 pub unsafe fn setAttributes(&self, attributes: &NSMutableArray<MDLVertexAttribute>);
499
500 #[unsafe(method(layouts))]
505 #[unsafe(method_family = none)]
506 pub unsafe fn layouts(&self) -> Retained<NSMutableArray<MDLVertexBufferLayout>>;
507
508 #[unsafe(method(setLayouts:))]
510 #[unsafe(method_family = none)]
511 pub unsafe fn setLayouts(&self, layouts: &NSMutableArray<MDLVertexBufferLayout>);
512
513 #[unsafe(method(reset))]
515 #[unsafe(method_family = none)]
516 pub unsafe fn reset(&self);
517
518 #[unsafe(method(setPackedStrides))]
521 #[unsafe(method_family = none)]
522 pub unsafe fn setPackedStrides(&self);
523
524 #[unsafe(method(setPackedOffsets))]
528 #[unsafe(method_family = none)]
529 pub unsafe fn setPackedOffsets(&self);
530 );
531}
532
533impl MDLVertexDescriptor {
535 extern_methods!(
536 #[unsafe(method(init))]
537 #[unsafe(method_family = init)]
538 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
539
540 #[unsafe(method(new))]
541 #[unsafe(method_family = new)]
542 pub unsafe fn new() -> Retained<Self>;
543 );
544}