Upgrade to 5.5 (#13)

* Upgrade parser to 5.5

* Added new compiled libraries

Also I changed the source for the example project to explicitly be the
version in the repo instead of a globally installed one

* Added new wasm lib

* New linux libs

* Update submodule
This commit is contained in:
Jannis 2024-11-19 01:12:26 +00:00 committed by GitHub
parent 73cd019d86
commit 6584a7749e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 669 additions and 184 deletions

@ -1 +1 @@
Subproject commit 5e9f1551c3a394c63a7080c093e51c621cac4159 Subproject commit 9903826e3e3c401ff1c8b3010e566f1e07df262c

View file

@ -0,0 +1,5 @@
FileVersion = 1
Projects = {example = {Path = "."}, raylib-beef = {Path = ".."}}
[Workspace]
StartupProject = "example"

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -7,15 +7,15 @@ namespace RaylibBeef;
/// Camera system modes /// Camera system modes
public enum CameraMode : c_int public enum CameraMode : c_int
{ {
/// Custom camera /// Camera custom, controlled by user (UpdateCamera() does nothing)
case CAMERA_CUSTOM = 0; case CAMERA_CUSTOM = 0;
/// Free camera /// Camera free mode
case CAMERA_FREE = 1; case CAMERA_FREE = 1;
/// Orbital camera /// Camera orbital, around target, zoom supported
case CAMERA_ORBITAL = 2; case CAMERA_ORBITAL = 2;
/// First person camera /// Camera first person
case CAMERA_FIRST_PERSON = 3; case CAMERA_FIRST_PERSON = 3;
/// Third person camera /// Camera third person
case CAMERA_THIRD_PERSON = 4; case CAMERA_THIRD_PERSON = 4;
public static operator int32 (CameraMode self) => (int32)self; public static operator int32 (CameraMode self) => (int32)self;

View file

@ -17,8 +17,6 @@ public enum CubemapLayout : c_int
case CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3; case CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3;
/// Layout is defined by a 4x3 cross with cubemap faces /// Layout is defined by a 4x3 cross with cubemap faces
case CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4; case CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4;
/// Layout is defined by a panorama image (equirrectangular map)
case CUBEMAP_LAYOUT_PANORAMA = 5;
public static operator int32 (CubemapLayout self) => (int32)self; public static operator int32 (CubemapLayout self) => (int32)self;
} }

View file

@ -19,17 +19,17 @@ public enum GamepadButton : c_int
case GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4; case GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4;
/// Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) /// Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
case GAMEPAD_BUTTON_RIGHT_FACE_UP = 5; case GAMEPAD_BUTTON_RIGHT_FACE_UP = 5;
/// Gamepad right button right (i.e. PS3: Square, Xbox: X) /// Gamepad right button right (i.e. PS3: Circle, Xbox: B)
case GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6; case GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6;
/// Gamepad right button down (i.e. PS3: Cross, Xbox: A) /// Gamepad right button down (i.e. PS3: Cross, Xbox: A)
case GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7; case GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7;
/// Gamepad right button left (i.e. PS3: Circle, Xbox: B) /// Gamepad right button left (i.e. PS3: Square, Xbox: X)
case GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8; case GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8;
/// Gamepad top/back trigger left (first), it could be a trailing button /// Gamepad top/back trigger left (first), it could be a trailing button
case GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9; case GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9;
/// Gamepad top/back trigger left (second), it could be a trailing button /// Gamepad top/back trigger left (second), it could be a trailing button
case GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10; case GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10;
/// Gamepad top/back trigger right (one), it could be a trailing button /// Gamepad top/back trigger right (first), it could be a trailing button
case GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11; case GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11;
/// Gamepad top/back trigger right (second), it could be a trailing button /// Gamepad top/back trigger right (second), it could be a trailing button
case GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12; case GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12;

View file

@ -222,7 +222,7 @@ public enum KeyboardKey : c_int
/// Key: Android back button /// Key: Android back button
case KEY_BACK = 4; case KEY_BACK = 4;
/// Key: Android menu button /// Key: Android menu button
case KEY_MENU = 82; case KEY_MENU = 5;
/// Key: Android volume up button /// Key: Android volume up button
case KEY_VOLUME_UP = 24; case KEY_VOLUME_UP = 24;
/// Key: Android volume down button /// Key: Android volume down button

View file

@ -39,19 +39,25 @@ public struct Mesh
/// Animated normals (after bones transformations) /// Animated normals (after bones transformations)
public void* animNormals; public void* animNormals;
/// Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) /// Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6)
public void* boneIds; public void* boneIds;
/// Vertex bone weight, up to 4 bones influence by vertex (skinning) /// Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7)
public void* boneWeights; public void* boneWeights;
/// Bones animated transformation matrices
public Matrix * boneMatrices;
/// Number of bones
public int32 boneCount;
/// OpenGL Vertex Array Object id /// OpenGL Vertex Array Object id
public int32 vaoId; public int32 vaoId;
/// OpenGL Vertex Buffer Objects id (default vertex data) /// OpenGL Vertex Buffer Objects id (default vertex data)
public void* vboId; public void* vboId;
public this(int32 vertexCount, int32 triangleCount, void* vertices, void* texcoords, void* texcoords2, void* normals, void* tangents, void* colors, void* indices, void* animVertices, void* animNormals, void* boneIds, void* boneWeights, int32 vaoId, void* vboId) public this(int32 vertexCount, int32 triangleCount, void* vertices, void* texcoords, void* texcoords2, void* normals, void* tangents, void* colors, void* indices, void* animVertices, void* animNormals, void* boneIds, void* boneWeights, Matrix * boneMatrices, int32 boneCount, int32 vaoId, void* vboId)
{ {
this.vertexCount = vertexCount; this.vertexCount = vertexCount;
this.triangleCount = triangleCount; this.triangleCount = triangleCount;
@ -66,6 +72,8 @@ public struct Mesh
this.animNormals = animNormals; this.animNormals = animNormals;
this.boneIds = boneIds; this.boneIds = boneIds;
this.boneWeights = boneWeights; this.boneWeights = boneWeights;
this.boneMatrices = boneMatrices;
this.boneCount = boneCount;
this.vaoId = vaoId; this.vaoId = vaoId;
this.vboId = vboId; this.vboId = vboId;
} }

View file

@ -9,7 +9,7 @@ public struct Ray
/// Ray position (origin) /// Ray position (origin)
public Vector3 position; public Vector3 position;
/// Ray direction /// Ray direction (normalized)
public Vector3 direction; public Vector3 direction;
public this(Vector3 position, Vector3 direction) public this(Vector3 position, Vector3 direction)

File diff suppressed because it is too large Load diff

View file

@ -65,6 +65,14 @@ public static class Raymath
[CLink] [CLink]
public static extern void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2); public static extern void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2);
///
[CLink]
public static extern Vector4 Vector4Zero();
///
[CLink]
public static extern Vector4 Vector4One();
/// ///
[CLink] [CLink]
public static extern Matrix MatrixIdentity(); public static extern Matrix MatrixIdentity();
@ -91,7 +99,7 @@ public static class Raymath
/// ///
[CLink] [CLink]
public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far); public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double nearPlane, double farPlane);
/// ///
[CLink] [CLink]
@ -187,6 +195,14 @@ public static class Raymath
[CLink] [CLink]
public static extern Vector2 Vector2Reflect(Vector2 v, Vector2 normal); public static extern Vector2 Vector2Reflect(Vector2 v, Vector2 normal);
///
[CLink]
public static extern Vector2 Vector2Min(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern Vector2 Vector2Max(Vector2 v1, Vector2 v2);
/// ///
[CLink] [CLink]
public static extern Vector2 Vector2Rotate(Vector2 v, float angle); public static extern Vector2 Vector2Rotate(Vector2 v, float angle);
@ -211,6 +227,10 @@ public static class Raymath
[CLink] [CLink]
public static extern int32 Vector2Equals(Vector2 p, Vector2 q); public static extern int32 Vector2Equals(Vector2 p, Vector2 q);
///
[CLink]
public static extern Vector2 Vector2Refract(Vector2 v, Vector2 n, float r);
/// ///
[CLink] [CLink]
public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2);
@ -291,10 +311,18 @@ public static class Raymath
[CLink] [CLink]
public static extern Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle); public static extern Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle);
///
[CLink]
public static extern Vector3 Vector3MoveTowards(Vector3 v, Vector3 target, float maxDistance);
/// ///
[CLink] [CLink]
public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount); public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);
///
[CLink]
public static extern Vector3 Vector3CubicHermite(Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount);
/// ///
[CLink] [CLink]
public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal); public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal);
@ -339,6 +367,86 @@ public static class Raymath
[CLink] [CLink]
public static extern Vector3 Vector3Refract(Vector3 v, Vector3 n, float r); public static extern Vector3 Vector3Refract(Vector3 v, Vector3 n, float r);
///
[CLink]
public static extern Vector4 Vector4Add(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4AddValue(Vector4 v, float add);
///
[CLink]
public static extern Vector4 Vector4Subtract(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4SubtractValue(Vector4 v, float add);
///
[CLink]
public static extern float Vector4Length(Vector4 v);
///
[CLink]
public static extern float Vector4LengthSqr(Vector4 v);
///
[CLink]
public static extern float Vector4DotProduct(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern float Vector4Distance(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern float Vector4DistanceSqr(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Scale(Vector4 v, float scale);
///
[CLink]
public static extern Vector4 Vector4Multiply(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Negate(Vector4 v);
///
[CLink]
public static extern Vector4 Vector4Divide(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Normalize(Vector4 v);
///
[CLink]
public static extern Vector4 Vector4Min(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Max(Vector4 v1, Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Lerp(Vector4 v1, Vector4 v2, float amount);
///
[CLink]
public static extern Vector4 Vector4MoveTowards(Vector4 v, Vector4 target, float maxDistance);
///
[CLink]
public static extern Vector4 Vector4Invert(Vector4 v);
///
[CLink]
public static extern int32 Vector4Equals(Vector4 p, Vector4 q);
/// ///
[CLink] [CLink]
public static extern float MatrixDeterminant(Matrix mat); public static extern float MatrixDeterminant(Matrix mat);
@ -439,6 +547,10 @@ public static class Raymath
[CLink] [CLink]
public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount); public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
///
[CLink]
public static extern Quaternion QuaternionCubicHermiteSpline(Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t);
/// ///
[CLink] [CLink]
public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to); public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
@ -471,6 +583,10 @@ public static class Raymath
[CLink] [CLink]
public static extern int32 QuaternionEquals(Quaternion p, Quaternion q); public static extern int32 QuaternionEquals(Quaternion p, Quaternion q);
///
[CLink]
public static extern void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotation, Vector3 *scale);
#else #else
/// ///
@ -549,6 +665,14 @@ public static class Raymath
[CLink] [CLink]
public static extern Vector2 Vector2Reflect(in Vector2 v, in Vector2 normal); public static extern Vector2 Vector2Reflect(in Vector2 v, in Vector2 normal);
///
[CLink]
public static extern Vector2 Vector2Min(in Vector2 v1, in Vector2 v2);
///
[CLink]
public static extern Vector2 Vector2Max(in Vector2 v1, in Vector2 v2);
/// ///
[CLink] [CLink]
public static extern Vector2 Vector2Rotate(in Vector2 v, float angle); public static extern Vector2 Vector2Rotate(in Vector2 v, float angle);
@ -573,6 +697,10 @@ public static class Raymath
[CLink] [CLink]
public static extern int32 Vector2Equals(in Vector2 p, in Vector2 q); public static extern int32 Vector2Equals(in Vector2 p, in Vector2 q);
///
[CLink]
public static extern Vector2 Vector2Refract(in Vector2 v, in Vector2 n, float r);
/// ///
[CLink] [CLink]
public static extern Vector3 Vector3Add(in Vector3 v1, in Vector3 v2); public static extern Vector3 Vector3Add(in Vector3 v1, in Vector3 v2);
@ -653,10 +781,18 @@ public static class Raymath
[CLink] [CLink]
public static extern Vector3 Vector3RotateByAxisAngle(in Vector3 v, in Vector3 axis, float angle); public static extern Vector3 Vector3RotateByAxisAngle(in Vector3 v, in Vector3 axis, float angle);
///
[CLink]
public static extern Vector3 Vector3MoveTowards(in Vector3 v, in Vector3 target, float maxDistance);
/// ///
[CLink] [CLink]
public static extern Vector3 Vector3Lerp(in Vector3 v1, in Vector3 v2, float amount); public static extern Vector3 Vector3Lerp(in Vector3 v1, in Vector3 v2, float amount);
///
[CLink]
public static extern Vector3 Vector3CubicHermite(in Vector3 v1, in Vector3 tangent1, in Vector3 v2, in Vector3 tangent2, float amount);
/// ///
[CLink] [CLink]
public static extern Vector3 Vector3Reflect(in Vector3 v, in Vector3 normal); public static extern Vector3 Vector3Reflect(in Vector3 v, in Vector3 normal);
@ -701,6 +837,86 @@ public static class Raymath
[CLink] [CLink]
public static extern Vector3 Vector3Refract(in Vector3 v, in Vector3 n, float r); public static extern Vector3 Vector3Refract(in Vector3 v, in Vector3 n, float r);
///
[CLink]
public static extern Vector4 Vector4Add(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4AddValue(in Vector4 v, float add);
///
[CLink]
public static extern Vector4 Vector4Subtract(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4SubtractValue(in Vector4 v, float add);
///
[CLink]
public static extern float Vector4Length(in Vector4 v);
///
[CLink]
public static extern float Vector4LengthSqr(in Vector4 v);
///
[CLink]
public static extern float Vector4DotProduct(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern float Vector4Distance(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern float Vector4DistanceSqr(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Scale(in Vector4 v, float scale);
///
[CLink]
public static extern Vector4 Vector4Multiply(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Negate(in Vector4 v);
///
[CLink]
public static extern Vector4 Vector4Divide(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Normalize(in Vector4 v);
///
[CLink]
public static extern Vector4 Vector4Min(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Max(in Vector4 v1, in Vector4 v2);
///
[CLink]
public static extern Vector4 Vector4Lerp(in Vector4 v1, in Vector4 v2, float amount);
///
[CLink]
public static extern Vector4 Vector4MoveTowards(in Vector4 v, in Vector4 target, float maxDistance);
///
[CLink]
public static extern Vector4 Vector4Invert(in Vector4 v);
///
[CLink]
public static extern int32 Vector4Equals(in Vector4 p, in Vector4 q);
/// ///
[CLink] [CLink]
public static extern float MatrixDeterminant(in Matrix mat); public static extern float MatrixDeterminant(in Matrix mat);
@ -801,6 +1017,10 @@ public static class Raymath
[CLink] [CLink]
public static extern Quaternion QuaternionSlerp(in Quaternion q1, in Quaternion q2, float amount); public static extern Quaternion QuaternionSlerp(in Quaternion q1, in Quaternion q2, float amount);
///
[CLink]
public static extern Quaternion QuaternionCubicHermiteSpline(in Quaternion q1, in Quaternion outTangent1, in Quaternion q2, in Quaternion inTangent2, float t);
/// ///
[CLink] [CLink]
public static extern Quaternion QuaternionFromVector3ToVector3(in Vector3 from, in Vector3 to); public static extern Quaternion QuaternionFromVector3ToVector3(in Vector3 from, in Vector3 to);
@ -833,6 +1053,10 @@ public static class Raymath
[CLink] [CLink]
public static extern int32 QuaternionEquals(in Quaternion p, in Quaternion q); public static extern int32 QuaternionEquals(in Quaternion p, in Quaternion q);
///
[CLink]
public static extern void MatrixDecompose(in Matrix mat, Vector3 *translation, Quaternion *rotation, Vector3 *scale);
#endif #endif
} }

View file

@ -5,7 +5,7 @@ namespace RaylibBeef;
public static class Rlgl public static class Rlgl
{ {
public const char8* RLGL_VERSION = "4.5"; public const char8* RLGL_VERSION = "5.0";
public const int32 RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192; public const int32 RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192;
@ -222,6 +222,30 @@ public static class Rlgl
/// GL_BLEND_COLOR /// GL_BLEND_COLOR
public const int32 RL_BLEND_COLOR = 32773; public const int32 RL_BLEND_COLOR = 32773;
/// GL_READ_FRAMEBUFFER
public const int32 RL_READ_FRAMEBUFFER = 36008;
/// GL_DRAW_FRAMEBUFFER
public const int32 RL_DRAW_FRAMEBUFFER = 36009;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION = 0;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD = 1;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL = 2;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR = 3;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT = 4;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 = 5;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES = 6;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS = 7;
public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS = 8;
/// Choose the current matrix to be transformed /// Choose the current matrix to be transformed
[CLink] [CLink]
public static extern void rlMatrixMode(int32 mode); public static extern void rlMatrixMode(int32 mode);
@ -266,6 +290,18 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlViewport(int32 x, int32 y, int32 width, int32 height); public static extern void rlViewport(int32 x, int32 y, int32 width, int32 height);
/// Set clip planes distances
[CLink]
public static extern void rlSetClipPlanes(double nearPlane, double farPlane);
/// Get cull plane distance near
[CLink]
public static extern double rlGetCullDistanceNear();
/// Get cull plane distance far
[CLink]
public static extern double rlGetCullDistanceFar();
/// Initialize drawing mode (how to organize vertex) /// Initialize drawing mode (how to organize vertex)
[CLink] [CLink]
public static extern void rlBegin(int32 mode); public static extern void rlBegin(int32 mode);
@ -390,6 +426,10 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlDisableFramebuffer(); public static extern void rlDisableFramebuffer();
/// Get the currently active render texture (fbo), 0 for default framebuffer
[CLink]
public static extern int32 rlGetActiveFramebuffer();
/// Activate multiple draw color buffers /// Activate multiple draw color buffers
[CLink] [CLink]
public static extern void rlActiveDrawBuffers(int32 count); public static extern void rlActiveDrawBuffers(int32 count);
@ -398,6 +438,10 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlBlitFramebuffer(int32 srcX, int32 srcY, int32 srcWidth, int32 srcHeight, int32 dstX, int32 dstY, int32 dstWidth, int32 dstHeight, int32 bufferMask); public static extern void rlBlitFramebuffer(int32 srcX, int32 srcY, int32 srcWidth, int32 srcHeight, int32 dstX, int32 dstY, int32 dstWidth, int32 dstHeight, int32 bufferMask);
/// Bind framebuffer (FBO)
[CLink]
public static extern void rlBindFramebuffer(int32 target, int32 framebuffer);
/// Enable color blending /// Enable color blending
[CLink] [CLink]
public static extern void rlEnableColorBlend(); public static extern void rlEnableColorBlend();
@ -430,6 +474,10 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlDisableBackfaceCulling(); public static extern void rlDisableBackfaceCulling();
/// Color mask control
[CLink]
public static extern void rlColorMask(bool r, bool g, bool b, bool a);
/// Set face culling mode /// Set face culling mode
[CLink] [CLink]
public static extern void rlSetCullFace(int32 mode); public static extern void rlSetCullFace(int32 mode);
@ -454,7 +502,7 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlEnablePointMode(); public static extern void rlEnablePointMode();
/// Disable wire mode ( and point ) maybe rename /// Disable wire (and point) mode
[CLink] [CLink]
public static extern void rlDisableWireMode(); public static extern void rlDisableWireMode();
@ -582,59 +630,59 @@ public static class Rlgl
[CLink] [CLink]
public static extern int32 rlLoadVertexArray(); public static extern int32 rlLoadVertexArray();
/// Load a vertex buffer attribute /// Load a vertex buffer object
[CLink] [CLink]
public static extern int32 rlLoadVertexBuffer(void *buffer, int32 size, bool dynamic); public static extern int32 rlLoadVertexBuffer(void *buffer, int32 size, bool dynamic);
/// Load a new attributes element buffer /// Load vertex buffer elements object
[CLink] [CLink]
public static extern int32 rlLoadVertexBufferElement(void *buffer, int32 size, bool dynamic); public static extern int32 rlLoadVertexBufferElement(void *buffer, int32 size, bool dynamic);
/// Update GPU buffer with new data /// Update vertex buffer object data on GPU buffer
[CLink] [CLink]
public static extern void rlUpdateVertexBuffer(int32 bufferId, void *data, int32 dataSize, int32 offset); public static extern void rlUpdateVertexBuffer(int32 bufferId, void *data, int32 dataSize, int32 offset);
/// Update vertex buffer elements with new data /// Update vertex buffer elements data on GPU buffer
[CLink] [CLink]
public static extern void rlUpdateVertexBufferElements(int32 id, void *data, int32 dataSize, int32 offset); public static extern void rlUpdateVertexBufferElements(int32 id, void *data, int32 dataSize, int32 offset);
/// /// Unload vertex array (vao)
[CLink] [CLink]
public static extern void rlUnloadVertexArray(int32 vaoId); public static extern void rlUnloadVertexArray(int32 vaoId);
/// /// Unload vertex buffer object
[CLink] [CLink]
public static extern void rlUnloadVertexBuffer(int32 vboId); public static extern void rlUnloadVertexBuffer(int32 vboId);
/// /// Set vertex attribute data configuration
[CLink] [CLink]
public static extern void rlSetVertexAttribute(int32 index, int32 compSize, int32 type, bool normalized, int32 stride, void *pointer); public static extern void rlSetVertexAttribute(int32 index, int32 compSize, int32 type, bool normalized, int32 stride, int32 offset);
/// /// Set vertex attribute data divisor
[CLink] [CLink]
public static extern void rlSetVertexAttributeDivisor(int32 index, int32 divisor); public static extern void rlSetVertexAttributeDivisor(int32 index, int32 divisor);
/// Set vertex attribute default value /// Set vertex attribute default value, when attribute to provided
[CLink] [CLink]
public static extern void rlSetVertexAttributeDefault(int32 locIndex, void *value, int32 attribType, int32 count); public static extern void rlSetVertexAttributeDefault(int32 locIndex, void *value, int32 attribType, int32 count);
/// /// Draw vertex array (currently active vao)
[CLink] [CLink]
public static extern void rlDrawVertexArray(int32 offset, int32 count); public static extern void rlDrawVertexArray(int32 offset, int32 count);
/// /// Draw vertex array elements
[CLink] [CLink]
public static extern void rlDrawVertexArrayElements(int32 offset, int32 count, void *buffer); public static extern void rlDrawVertexArrayElements(int32 offset, int32 count, void *buffer);
/// /// Draw vertex array (currently active vao) with instancing
[CLink] [CLink]
public static extern void rlDrawVertexArrayInstanced(int32 offset, int32 count, int32 instances); public static extern void rlDrawVertexArrayInstanced(int32 offset, int32 count, int32 instances);
/// /// Draw vertex array elements with instancing
[CLink] [CLink]
public static extern void rlDrawVertexArrayElementsInstanced(int32 offset, int32 count, void *buffer, int32 instances); public static extern void rlDrawVertexArrayElementsInstanced(int32 offset, int32 count, void *buffer, int32 instances);
/// Load texture in GPU /// Load texture data
[CLink] [CLink]
public static extern int32 rlLoadTexture(void *data, int32 width, int32 height, int32 format, int32 mipmapCount); public static extern int32 rlLoadTexture(void *data, int32 width, int32 height, int32 format, int32 mipmapCount);
@ -642,11 +690,11 @@ public static class Rlgl
[CLink] [CLink]
public static extern int32 rlLoadTextureDepth(int32 width, int32 height, bool useRenderBuffer); public static extern int32 rlLoadTextureDepth(int32 width, int32 height, bool useRenderBuffer);
/// Load texture cubemap /// Load texture cubemap data
[CLink] [CLink]
public static extern int32 rlLoadTextureCubemap(void *data, int32 size, int32 format); public static extern int32 rlLoadTextureCubemap(void *data, int32 size, int32 format, int32 mipmapCount);
/// Update GPU texture with new data /// Update texture with new data on GPU
[CLink] [CLink]
public static extern void rlUpdateTexture(int32 id, int32 offsetX, int32 offsetY, int32 width, int32 height, int32 format, void *data); public static extern void rlUpdateTexture(int32 id, int32 offsetX, int32 offsetY, int32 width, int32 height, int32 format, void *data);
@ -676,7 +724,7 @@ public static class Rlgl
/// Load an empty framebuffer /// Load an empty framebuffer
[CLink] [CLink]
public static extern int32 rlLoadFramebuffer(int32 width, int32 height); public static extern int32 rlLoadFramebuffer();
/// Attach texture/renderbuffer to a framebuffer /// Attach texture/renderbuffer to a framebuffer
[CLink] [CLink]
@ -718,6 +766,10 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlSetUniform(int32 locIndex, void *value, int32 uniformType, int32 count); public static extern void rlSetUniform(int32 locIndex, void *value, int32 uniformType, int32 count);
/// Set shader value matrices
[CLink]
public static extern void rlSetUniformMatrices(int32 locIndex, Matrix *mat, int32 count);
/// Set shader value sampler /// Set shader value sampler
[CLink] [CLink]
public static extern void rlSetUniformSampler(int32 locIndex, int32 textureId); public static extern void rlSetUniformSampler(int32 locIndex, int32 textureId);

View file

@ -59,6 +59,12 @@ public enum ShaderLocationIndex : c_int
case SHADER_LOC_MAP_PREFILTER = 24; case SHADER_LOC_MAP_PREFILTER = 24;
/// Shader location: sampler2d texture: brdf /// Shader location: sampler2d texture: brdf
case SHADER_LOC_MAP_BRDF = 25; case SHADER_LOC_MAP_BRDF = 25;
/// Shader location: vertex attribute: boneIds
case SHADER_LOC_VERTEX_BONEIDS = 26;
/// Shader location: vertex attribute: boneWeights
case SHADER_LOC_VERTEX_BONEWEIGHTS = 27;
/// Shader location: array of matrices uniform: boneMatrices
case SHADER_LOC_BONE_MATRICES = 28;
public static operator int32 (ShaderLocationIndex self) => (int32)self; public static operator int32 (ShaderLocationIndex self) => (int32)self;
} }

View file

@ -18,9 +18,6 @@ public struct VrDeviceInfo
/// Vertical size in meters /// Vertical size in meters
public float vScreenSize; public float vScreenSize;
/// Screen center in meters
public float vScreenCenter;
/// Distance between eye and display in meters /// Distance between eye and display in meters
public float eyeToScreenDistance; public float eyeToScreenDistance;
@ -36,13 +33,12 @@ public struct VrDeviceInfo
/// Chromatic aberration correction parameters /// Chromatic aberration correction parameters
public float[4] chromaAbCorrection; public float[4] chromaAbCorrection;
public this(int32 hResolution, int32 vResolution, float hScreenSize, float vScreenSize, float vScreenCenter, float eyeToScreenDistance, float lensSeparationDistance, float interpupillaryDistance, float[4] lensDistortionValues, float[4] chromaAbCorrection) public this(int32 hResolution, int32 vResolution, float hScreenSize, float vScreenSize, float eyeToScreenDistance, float lensSeparationDistance, float interpupillaryDistance, float[4] lensDistortionValues, float[4] chromaAbCorrection)
{ {
this.hResolution = hResolution; this.hResolution = hResolution;
this.vResolution = vResolution; this.vResolution = vResolution;
this.hScreenSize = hScreenSize; this.hScreenSize = hScreenSize;
this.vScreenSize = vScreenSize; this.vScreenSize = vScreenSize;
this.vScreenCenter = vScreenCenter;
this.eyeToScreenDistance = eyeToScreenDistance; this.eyeToScreenDistance = eyeToScreenDistance;
this.lensSeparationDistance = lensSeparationDistance; this.lensSeparationDistance = lensSeparationDistance;
this.interpupillaryDistance = interpupillaryDistance; this.interpupillaryDistance = interpupillaryDistance;

View file

@ -23,8 +23,16 @@ public enum rlShaderUniformDataType : c_int
case RL_SHADER_UNIFORM_IVEC3 = 6; case RL_SHADER_UNIFORM_IVEC3 = 6;
/// Shader uniform type: ivec4 (4 int) /// Shader uniform type: ivec4 (4 int)
case RL_SHADER_UNIFORM_IVEC4 = 7; case RL_SHADER_UNIFORM_IVEC4 = 7;
/// Shader uniform type: unsigned int
case RL_SHADER_UNIFORM_UINT = 8;
/// Shader uniform type: uivec2 (2 unsigned int)
case RL_SHADER_UNIFORM_UIVEC2 = 9;
/// Shader uniform type: uivec3 (3 unsigned int)
case RL_SHADER_UNIFORM_UIVEC3 = 10;
/// Shader uniform type: uivec4 (4 unsigned int)
case RL_SHADER_UNIFORM_UIVEC4 = 11;
/// Shader uniform type: sampler2d /// Shader uniform type: sampler2d
case RL_SHADER_UNIFORM_SAMPLER2D = 8; case RL_SHADER_UNIFORM_SAMPLER2D = 12;
public static operator int32 (rlShaderUniformDataType self) => (int32)self; public static operator int32 (rlShaderUniformDataType self) => (int32)self;
} }

View file

@ -15,6 +15,9 @@ public struct rlVertexBuffer
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
public void* texcoords; public void* texcoords;
/// Vertex normal (XYZ - 3 components per vertex) (shader-location = 2)
public void* normals;
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
public void* colors; public void* colors;
@ -24,14 +27,15 @@ public struct rlVertexBuffer
/// OpenGL Vertex Array Object id /// OpenGL Vertex Array Object id
public void* vaoId; public void* vaoId;
/// OpenGL Vertex Buffer Objects id (4 types of vertex data) /// OpenGL Vertex Buffer Objects id (5 types of vertex data)
public int32[4] vboId; public int32[5] vboId;
public this(int32 elementCount, void* vertices, void* texcoords, void* colors, void* indices, void* vaoId, int32[4] vboId) public this(int32 elementCount, void* vertices, void* texcoords, void* normals, void* colors, void* indices, void* vaoId, int32[5] vboId)
{ {
this.elementCount = elementCount; this.elementCount = elementCount;
this.vertices = vertices; this.vertices = vertices;
this.texcoords = texcoords; this.texcoords = texcoords;
this.normals = normals;
this.colors = colors; this.colors = colors;
this.indices = indices; this.indices = indices;
this.vaoId = vaoId; this.vaoId = vaoId;