MTLVertexAttributeDescriptor.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using static Veldrid.MetalBindings.ObjectiveCRuntime;
  3. namespace Veldrid.MetalBindings
  4. {
  5. public struct MTLVertexAttributeDescriptor
  6. {
  7. public readonly IntPtr NativePtr;
  8. public MTLVertexAttributeDescriptor(IntPtr ptr) => NativePtr = ptr;
  9. public MTLVertexFormat format
  10. {
  11. get => (MTLVertexFormat)uint_objc_msgSend(NativePtr, sel_format);
  12. set => objc_msgSend(NativePtr, sel_setFormat, (uint)value);
  13. }
  14. public UIntPtr offset
  15. {
  16. get => UIntPtr_objc_msgSend(NativePtr, sel_offset);
  17. set => objc_msgSend(NativePtr, sel_setOffset, value);
  18. }
  19. public UIntPtr bufferIndex
  20. {
  21. get => UIntPtr_objc_msgSend(NativePtr, sel_bufferIndex);
  22. set => objc_msgSend(NativePtr, sel_setBufferIndex, value);
  23. }
  24. private static readonly Selector sel_format = "format";
  25. private static readonly Selector sel_setFormat = "setFormat:";
  26. private static readonly Selector sel_offset = "offset";
  27. private static readonly Selector sel_setOffset = "setOffset:";
  28. private static readonly Selector sel_bufferIndex = "bufferIndex";
  29. private static readonly Selector sel_setBufferIndex = "setBufferIndex:";
  30. }
  31. }