use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static MDLVertexAttributeAnisotropy: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeBinormal: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeBitangent: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeColor: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeEdgeCrease: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeJointIndices: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeJointWeights: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeNormal: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeOcclusionValue: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributePosition: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeShadingBasisU: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeShadingBasisV: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeSubdivisionStencil: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeTangent: &'static NSString;
}
extern "C" {
pub static MDLVertexAttributeTextureCoordinate: &'static NSString;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLVertexFormat(pub NSUInteger);
impl MDLVertexFormat {
#[doc(alias = "MDLVertexFormatInvalid")]
pub const Invalid: Self = Self(0);
#[doc(alias = "MDLVertexFormatPackedBit")]
pub const PackedBit: Self = Self(0x1000);
#[doc(alias = "MDLVertexFormatUCharBits")]
pub const UCharBits: Self = Self(0x10000);
#[doc(alias = "MDLVertexFormatCharBits")]
pub const CharBits: Self = Self(0x20000);
#[doc(alias = "MDLVertexFormatUCharNormalizedBits")]
pub const UCharNormalizedBits: Self = Self(0x30000);
#[doc(alias = "MDLVertexFormatCharNormalizedBits")]
pub const CharNormalizedBits: Self = Self(0x40000);
#[doc(alias = "MDLVertexFormatUShortBits")]
pub const UShortBits: Self = Self(0x50000);
#[doc(alias = "MDLVertexFormatShortBits")]
pub const ShortBits: Self = Self(0x60000);
#[doc(alias = "MDLVertexFormatUShortNormalizedBits")]
pub const UShortNormalizedBits: Self = Self(0x70000);
#[doc(alias = "MDLVertexFormatShortNormalizedBits")]
pub const ShortNormalizedBits: Self = Self(0x80000);
#[doc(alias = "MDLVertexFormatUIntBits")]
pub const UIntBits: Self = Self(0x90000);
#[doc(alias = "MDLVertexFormatIntBits")]
pub const IntBits: Self = Self(0xA0000);
#[doc(alias = "MDLVertexFormatHalfBits")]
pub const HalfBits: Self = Self(0xB0000);
#[doc(alias = "MDLVertexFormatFloatBits")]
pub const FloatBits: Self = Self(0xC0000);
#[doc(alias = "MDLVertexFormatUChar")]
pub const UChar: Self = Self(MDLVertexFormat::UCharBits.0 | 1);
#[doc(alias = "MDLVertexFormatUChar2")]
pub const UChar2: Self = Self(MDLVertexFormat::UCharBits.0 | 2);
#[doc(alias = "MDLVertexFormatUChar3")]
pub const UChar3: Self = Self(MDLVertexFormat::UCharBits.0 | 3);
#[doc(alias = "MDLVertexFormatUChar4")]
pub const UChar4: Self = Self(MDLVertexFormat::UCharBits.0 | 4);
#[doc(alias = "MDLVertexFormatChar")]
pub const Char: Self = Self(MDLVertexFormat::CharBits.0 | 1);
#[doc(alias = "MDLVertexFormatChar2")]
pub const Char2: Self = Self(MDLVertexFormat::CharBits.0 | 2);
#[doc(alias = "MDLVertexFormatChar3")]
pub const Char3: Self = Self(MDLVertexFormat::CharBits.0 | 3);
#[doc(alias = "MDLVertexFormatChar4")]
pub const Char4: Self = Self(MDLVertexFormat::CharBits.0 | 4);
#[doc(alias = "MDLVertexFormatUCharNormalized")]
pub const UCharNormalized: Self = Self(MDLVertexFormat::UCharNormalizedBits.0 | 1);
#[doc(alias = "MDLVertexFormatUChar2Normalized")]
pub const UChar2Normalized: Self = Self(MDLVertexFormat::UCharNormalizedBits.0 | 2);
#[doc(alias = "MDLVertexFormatUChar3Normalized")]
pub const UChar3Normalized: Self = Self(MDLVertexFormat::UCharNormalizedBits.0 | 3);
#[doc(alias = "MDLVertexFormatUChar4Normalized")]
pub const UChar4Normalized: Self = Self(MDLVertexFormat::UCharNormalizedBits.0 | 4);
#[doc(alias = "MDLVertexFormatCharNormalized")]
pub const CharNormalized: Self = Self(MDLVertexFormat::CharNormalizedBits.0 | 1);
#[doc(alias = "MDLVertexFormatChar2Normalized")]
pub const Char2Normalized: Self = Self(MDLVertexFormat::CharNormalizedBits.0 | 2);
#[doc(alias = "MDLVertexFormatChar3Normalized")]
pub const Char3Normalized: Self = Self(MDLVertexFormat::CharNormalizedBits.0 | 3);
#[doc(alias = "MDLVertexFormatChar4Normalized")]
pub const Char4Normalized: Self = Self(MDLVertexFormat::CharNormalizedBits.0 | 4);
#[doc(alias = "MDLVertexFormatUShort")]
pub const UShort: Self = Self(MDLVertexFormat::UShortBits.0 | 1);
#[doc(alias = "MDLVertexFormatUShort2")]
pub const UShort2: Self = Self(MDLVertexFormat::UShortBits.0 | 2);
#[doc(alias = "MDLVertexFormatUShort3")]
pub const UShort3: Self = Self(MDLVertexFormat::UShortBits.0 | 3);
#[doc(alias = "MDLVertexFormatUShort4")]
pub const UShort4: Self = Self(MDLVertexFormat::UShortBits.0 | 4);
#[doc(alias = "MDLVertexFormatShort")]
pub const Short: Self = Self(MDLVertexFormat::ShortBits.0 | 1);
#[doc(alias = "MDLVertexFormatShort2")]
pub const Short2: Self = Self(MDLVertexFormat::ShortBits.0 | 2);
#[doc(alias = "MDLVertexFormatShort3")]
pub const Short3: Self = Self(MDLVertexFormat::ShortBits.0 | 3);
#[doc(alias = "MDLVertexFormatShort4")]
pub const Short4: Self = Self(MDLVertexFormat::ShortBits.0 | 4);
#[doc(alias = "MDLVertexFormatUShortNormalized")]
pub const UShortNormalized: Self = Self(MDLVertexFormat::UShortNormalizedBits.0 | 1);
#[doc(alias = "MDLVertexFormatUShort2Normalized")]
pub const UShort2Normalized: Self = Self(MDLVertexFormat::UShortNormalizedBits.0 | 2);
#[doc(alias = "MDLVertexFormatUShort3Normalized")]
pub const UShort3Normalized: Self = Self(MDLVertexFormat::UShortNormalizedBits.0 | 3);
#[doc(alias = "MDLVertexFormatUShort4Normalized")]
pub const UShort4Normalized: Self = Self(MDLVertexFormat::UShortNormalizedBits.0 | 4);
#[doc(alias = "MDLVertexFormatShortNormalized")]
pub const ShortNormalized: Self = Self(MDLVertexFormat::ShortNormalizedBits.0 | 1);
#[doc(alias = "MDLVertexFormatShort2Normalized")]
pub const Short2Normalized: Self = Self(MDLVertexFormat::ShortNormalizedBits.0 | 2);
#[doc(alias = "MDLVertexFormatShort3Normalized")]
pub const Short3Normalized: Self = Self(MDLVertexFormat::ShortNormalizedBits.0 | 3);
#[doc(alias = "MDLVertexFormatShort4Normalized")]
pub const Short4Normalized: Self = Self(MDLVertexFormat::ShortNormalizedBits.0 | 4);
#[doc(alias = "MDLVertexFormatUInt")]
pub const UInt: Self = Self(MDLVertexFormat::UIntBits.0 | 1);
#[doc(alias = "MDLVertexFormatUInt2")]
pub const UInt2: Self = Self(MDLVertexFormat::UIntBits.0 | 2);
#[doc(alias = "MDLVertexFormatUInt3")]
pub const UInt3: Self = Self(MDLVertexFormat::UIntBits.0 | 3);
#[doc(alias = "MDLVertexFormatUInt4")]
pub const UInt4: Self = Self(MDLVertexFormat::UIntBits.0 | 4);
#[doc(alias = "MDLVertexFormatInt")]
pub const Int: Self = Self(MDLVertexFormat::IntBits.0 | 1);
#[doc(alias = "MDLVertexFormatInt2")]
pub const Int2: Self = Self(MDLVertexFormat::IntBits.0 | 2);
#[doc(alias = "MDLVertexFormatInt3")]
pub const Int3: Self = Self(MDLVertexFormat::IntBits.0 | 3);
#[doc(alias = "MDLVertexFormatInt4")]
pub const Int4: Self = Self(MDLVertexFormat::IntBits.0 | 4);
#[doc(alias = "MDLVertexFormatHalf")]
pub const Half: Self = Self(MDLVertexFormat::HalfBits.0 | 1);
#[doc(alias = "MDLVertexFormatHalf2")]
pub const Half2: Self = Self(MDLVertexFormat::HalfBits.0 | 2);
#[doc(alias = "MDLVertexFormatHalf3")]
pub const Half3: Self = Self(MDLVertexFormat::HalfBits.0 | 3);
#[doc(alias = "MDLVertexFormatHalf4")]
pub const Half4: Self = Self(MDLVertexFormat::HalfBits.0 | 4);
#[doc(alias = "MDLVertexFormatFloat")]
pub const Float: Self = Self(MDLVertexFormat::FloatBits.0 | 1);
#[doc(alias = "MDLVertexFormatFloat2")]
pub const Float2: Self = Self(MDLVertexFormat::FloatBits.0 | 2);
#[doc(alias = "MDLVertexFormatFloat3")]
pub const Float3: Self = Self(MDLVertexFormat::FloatBits.0 | 3);
#[doc(alias = "MDLVertexFormatFloat4")]
pub const Float4: Self = Self(MDLVertexFormat::FloatBits.0 | 4);
#[doc(alias = "MDLVertexFormatInt1010102Normalized")]
pub const Int1010102Normalized: Self =
Self(MDLVertexFormat::IntBits.0 | MDLVertexFormat::PackedBit.0 | 4);
#[doc(alias = "MDLVertexFormatUInt1010102Normalized")]
pub const UInt1010102Normalized: Self =
Self(MDLVertexFormat::UIntBits.0 | MDLVertexFormat::PackedBit.0 | 4);
}
unsafe impl Encode for MDLVertexFormat {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MDLVertexFormat {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLVertexBufferLayout;
);
extern_conformance!(
unsafe impl NSCopying for MDLVertexBufferLayout {}
);
unsafe impl CopyingHelper for MDLVertexBufferLayout {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MDLVertexBufferLayout {}
);
impl MDLVertexBufferLayout {
extern_methods!(
#[unsafe(method(initWithStride:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithStride(this: Allocated<Self>, stride: NSUInteger) -> Retained<Self>;
#[unsafe(method(stride))]
#[unsafe(method_family = none)]
pub unsafe fn stride(&self) -> NSUInteger;
#[unsafe(method(setStride:))]
#[unsafe(method_family = none)]
pub unsafe fn setStride(&self, stride: NSUInteger);
);
}
impl MDLVertexBufferLayout {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLVertexAttribute;
);
extern_conformance!(
unsafe impl NSCopying for MDLVertexAttribute {}
);
unsafe impl CopyingHelper for MDLVertexAttribute {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MDLVertexAttribute {}
);
impl MDLVertexAttribute {
extern_methods!(
#[unsafe(method(initWithName:format:offset:bufferIndex:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_format_offset_bufferIndex(
this: Allocated<Self>,
name: &NSString,
format: MDLVertexFormat,
offset: NSUInteger,
buffer_index: NSUInteger,
) -> Retained<Self>;
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: &NSString);
#[unsafe(method(format))]
#[unsafe(method_family = none)]
pub unsafe fn format(&self) -> MDLVertexFormat;
#[unsafe(method(setFormat:))]
#[unsafe(method_family = none)]
pub unsafe fn setFormat(&self, format: MDLVertexFormat);
#[unsafe(method(offset))]
#[unsafe(method_family = none)]
pub unsafe fn offset(&self) -> NSUInteger;
#[unsafe(method(setOffset:))]
#[unsafe(method_family = none)]
pub unsafe fn setOffset(&self, offset: NSUInteger);
#[unsafe(method(bufferIndex))]
#[unsafe(method_family = none)]
pub unsafe fn bufferIndex(&self) -> NSUInteger;
#[unsafe(method(setBufferIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn setBufferIndex(&self, buffer_index: NSUInteger);
#[unsafe(method(time))]
#[unsafe(method_family = none)]
pub unsafe fn time(&self) -> NSTimeInterval;
#[unsafe(method(setTime:))]
#[unsafe(method_family = none)]
pub unsafe fn setTime(&self, time: NSTimeInterval);
);
}
impl MDLVertexAttribute {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLVertexDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MDLVertexDescriptor {}
);
unsafe impl CopyingHelper for MDLVertexDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MDLVertexDescriptor {}
);
impl MDLVertexDescriptor {
extern_methods!(
#[unsafe(method(initWithVertexDescriptor:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithVertexDescriptor(
this: Allocated<Self>,
vertex_descriptor: &MDLVertexDescriptor,
) -> Retained<Self>;
#[unsafe(method(attributeNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn attributeNamed(
&self,
name: &NSString,
) -> Option<Retained<MDLVertexAttribute>>;
#[unsafe(method(addOrReplaceAttribute:))]
#[unsafe(method_family = none)]
pub unsafe fn addOrReplaceAttribute(&self, attribute: &MDLVertexAttribute);
#[unsafe(method(removeAttributeNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn removeAttributeNamed(&self, name: &NSString);
#[unsafe(method(attributes))]
#[unsafe(method_family = none)]
pub unsafe fn attributes(&self) -> Retained<NSMutableArray<MDLVertexAttribute>>;
#[unsafe(method(setAttributes:))]
#[unsafe(method_family = none)]
pub unsafe fn setAttributes(&self, attributes: &NSMutableArray<MDLVertexAttribute>);
#[unsafe(method(layouts))]
#[unsafe(method_family = none)]
pub unsafe fn layouts(&self) -> Retained<NSMutableArray<MDLVertexBufferLayout>>;
#[unsafe(method(setLayouts:))]
#[unsafe(method_family = none)]
pub unsafe fn setLayouts(&self, layouts: &NSMutableArray<MDLVertexBufferLayout>);
#[unsafe(method(reset))]
#[unsafe(method_family = none)]
pub unsafe fn reset(&self);
#[unsafe(method(setPackedStrides))]
#[unsafe(method_family = none)]
pub unsafe fn setPackedStrides(&self);
#[unsafe(method(setPackedOffsets))]
#[unsafe(method_family = none)]
pub unsafe fn setPackedOffsets(&self);
);
}
impl MDLVertexDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}