Add Vector/Color overloads to Rlgl (#348)
This commit is contained in:
parent
b3c27954c8
commit
44a9eb9738
1 changed files with 55 additions and 0 deletions
|
|
@ -123,16 +123,34 @@ public static unsafe partial class Rlgl
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Translatef(float x, float y, float z);
|
||||
|
||||
/// <inheritdoc cref="Translatef(float, float, float)"/>
|
||||
public static void Translatef(Vector3 v)
|
||||
{
|
||||
Translatef(v.X, v.Y, v.Z);
|
||||
}
|
||||
|
||||
/// <summary>Multiply the current matrix by a rotation matrix</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlRotatef")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Rotatef(float angle, float x, float y, float z);
|
||||
|
||||
/// <inheritdoc cref="Rotatef(float, float, float, float)"/>
|
||||
public static void Rotatef(float angle, Vector3 v)
|
||||
{
|
||||
Rotatef(angle, v.X, v.Y, v.Z);
|
||||
}
|
||||
|
||||
/// <summary>Multiply the current matrix by a scaling matrix</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlScalef")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Scalef(float x, float y, float z);
|
||||
|
||||
/// <inheritdoc cref="Scalef(float, float, float)"/>
|
||||
public static void Scalef(Vector3 v)
|
||||
{
|
||||
Scalef(v.X, v.Y, v.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiply the current matrix by another matrix<br/>
|
||||
/// Current Matrix can be set via <see cref="MatrixMode(int)"/>
|
||||
|
|
@ -200,6 +218,7 @@ public static unsafe partial class Rlgl
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Begin(int mode);
|
||||
|
||||
/// <inheritdoc cref="Begin(int)"/>
|
||||
public static void Begin(DrawMode mode)
|
||||
{
|
||||
Begin((int)mode);
|
||||
|
|
@ -220,26 +239,56 @@ public static unsafe partial class Rlgl
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Vertex2f(float x, float y);
|
||||
|
||||
/// <inheritdoc cref="Vertex2f(float, float)"/>
|
||||
public static void Vertex2f(Vector2 v)
|
||||
{
|
||||
Vertex2f(v.X, v.Y);
|
||||
}
|
||||
|
||||
/// <summary>Define one vertex (position) - 3 float</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlVertex3f")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Vertex3f(float x, float y, float z);
|
||||
|
||||
/// <inheritdoc cref="Vertex3f(float, float, float)"/>
|
||||
public static void Vertex3f(Vector3 v)
|
||||
{
|
||||
Vertex3f(v.X, v.Y, v.Z);
|
||||
}
|
||||
|
||||
/// <summary>Define one vertex (texture coordinate) - 2 float</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlTexCoord2f")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void TexCoord2f(float x, float y);
|
||||
|
||||
/// <inheritdoc cref="TexCoord2f(float, float)"/>
|
||||
public static void TexCoord2f(Vector2 v)
|
||||
{
|
||||
TexCoord2f(v.X, v.Y);
|
||||
}
|
||||
|
||||
/// <summary>Define one vertex (normal) - 3 float</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlNormal3f")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Normal3f(float x, float y, float z);
|
||||
|
||||
/// <inheritdoc cref="Normal3f(float, float, float)"/>
|
||||
public static void Normal3f(Vector3 v)
|
||||
{
|
||||
Normal3f(v.X, v.Y, v.Z);
|
||||
}
|
||||
|
||||
/// <summary>Define one vertex (color) - 4 byte</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlColor4ub")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Color4ub(byte r, byte g, byte b, byte a);
|
||||
|
||||
/// <inheritdoc cref="Color4ub(byte, byte, byte, byte)"/>
|
||||
public static void Color4ub(Color color)
|
||||
{
|
||||
Color4ub(color.R, color.G, color.B, color.A);
|
||||
}
|
||||
|
||||
/// <summary>Define one vertex (color) - 3 float</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlColor3f")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -250,6 +299,12 @@ public static unsafe partial class Rlgl
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Color4f(float x, float y, float z, float w);
|
||||
|
||||
/// <inheritdoc cref="Color4f(float, float, float, float)"/>
|
||||
public static void Color4f(Vector4 normalized)
|
||||
{
|
||||
Color4f(normalized.X, normalized.Y, normalized.Z, normalized.W);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------
|
||||
// Functions Declaration - OpenGL equivalent functions (common to 1.1, 3.3+, ES2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue