Watch
2
0
Fork
You've already forked raylib-cs
0

VertexBuffer struct updated

This commit is contained in:
JupiterRider 2024-12-06 21:19:27 +01:00
commit 2f1929b659

View file

@ -61,6 +61,11 @@ public unsafe partial struct VertexBuffer
/// </summary>
public float* TexCoords;
/// <summary>
/// Vertex normal (XYZ - 3 components per vertex) (shader-location = 2)
/// </summary>
public float* Normals;
/// <summary>
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
/// </summary>
@ -79,9 +84,9 @@ public unsafe partial struct VertexBuffer
public uint VaoId;
/// <summary>
/// OpenGL Vertex Buffer Objects id (4 types of vertex data)
/// OpenGL Vertex Buffer Objects id (5 types of vertex data)
/// </summary>
public fixed uint VboId[4];
public fixed uint VboId[5];
/// <summary>
/// Access <see cref="Vertices"/>
@ -99,6 +104,14 @@ public unsafe partial struct VertexBuffer
return new(TexCoords, ElementCount * sizeof(float) / sizeof(T));
}
/// <summary>
/// Access <see cref="Normals"/>
/// </summary>
public readonly Span<T> NormalsAs<T>() where T : unmanaged
{
return new(Normals, ElementCount * sizeof(float) / sizeof(T));
}
/// <summary>
/// Access <see cref="Colors"/>
/// </summary>