struct property

StructType<RlVertexBufferD> struct
final

Describes the raw memory layout, construction, and pointer representation of this struct type.

Implementation

static final StructType<RlVertexBufferD> struct = .new(
  factory: RlVertexBufferD.new,
  layout: .aligned<RlVertexBufferField>({
    .elementCount: RInt(), // Number of elements in the buffer (QUADS)
    .vertices:     RPointer(RFloat()), // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
    .texcoords:    RPointer(RFloat()), // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
    .normals:      RPointer(RFloat()), // Vertex normal (XYZ - 3 components per vertex) (shader-location = 2)
    .colors:       RPointer(RUnsignedChar()), // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
    .indices: switch (currentRaylibPlatform) {
      .native   => RPointer(RUnsignedInt()), // Vertex indices (in case vertex data comes indexed) (6 indices per quad)
      .web      => RPointer(RUnsignedShort()), // Vertex indices (in case vertex data comes indexed) (6 indices per quad)
    },
    .vaoId:        RUnsignedInt(), // OpenGL Vertex Array Object id
    .vboId:        RArray(RUnsignedInt(), BASE_vboIdCount), // OpenGL Vertex Buffer Objects id (5 types of vertex data)
  }),
);