2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-09-09 03:01:41 -04:00

Update names of methods, variables, and other elements

This commit is contained in:
MrScautHD
2023-07-15 13:28:19 +02:00
committed by GitHub
parent 10c0a6dd91
commit fd4ea148b9
27 changed files with 1190 additions and 1204 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -5,12 +5,12 @@ using System.Security;
namespace Raylib_cs namespace Raylib_cs
{ {
// NOTE: Helper types to be used instead of array return types for *ToFloat functions // NOTE: Helper types to be used instead of array return types for *ToFloat functions
public unsafe struct float3 public unsafe struct Float3
{ {
public fixed float v[3]; public fixed float v[3];
} }
public unsafe struct float16 public unsafe struct Float16
{ {
public fixed float v[16]; public fixed float v[16];
} }
@@ -21,22 +21,22 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Used by DllImport to load the native library /// Used by DllImport to load the native library
/// </summary> /// </summary>
public const string nativeLibName = "raylib"; public const string NativeLibName = "raylib";
/// <summary>Clamp float value</summary> /// <summary>Clamp float value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Clamp(float value, float min, float max); public static extern float Clamp(float value, float min, float max);
/// <summary>Calculate linear interpolation between two vectors</summary> /// <summary>Calculate linear interpolation between two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Lerp(float start, float end, float amount); public static extern float Lerp(float start, float end, float amount);
/// <summary>Normalize input value within input range</summary> /// <summary>Normalize input value within input range</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Normalize(float value, float start, float end); public static extern float Normalize(float value, float start, float end);
/// <summary>Remap input value within input range to output range</summary> /// <summary>Remap input value within input range to output range</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Remap( public static extern float Remap(
float value, float value,
float inputStart, float inputStart,
@@ -46,62 +46,62 @@ namespace Raylib_cs
); );
/// <summary>Wrap input value from min to max</summary> /// <summary>Wrap input value from min to max</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Wrap(float value, float min, float max); public static extern float Wrap(float value, float min, float max);
/// <summary>Check whether two given floats are almost equal</summary> /// <summary>Check whether two given floats are almost equal</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int FloatEquals(float x, float y); public static extern int FloatEquals(float x, float y);
/// <summary>Vector with components value 0.0f</summary> /// <summary>Vector with components value 0.0f</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Zero(); public static extern Vector2 Vector2Zero();
/// <summary>Vector with components value 1.0f</summary> /// <summary>Vector with components value 1.0f</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2One(); public static extern Vector2 Vector2One();
/// <summary>Add two vectors (v1 + v2)</summary> /// <summary>Add two vectors (v1 + v2)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2); public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2);
/// <summary>Add vector and float value</summary> /// <summary>Add vector and float value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2AddValue(Vector2 v, float add); public static extern Vector2 Vector2AddValue(Vector2 v, float add);
/// <summary>Subtract two vectors (v1 - v2)</summary> /// <summary>Subtract two vectors (v1 - v2)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2); public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2);
/// <summary>Subtract vector by float value</summary> /// <summary>Subtract vector by float value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2SubtractValue(Vector2 v, float sub); public static extern Vector2 Vector2SubtractValue(Vector2 v, float sub);
/// <summary>Calculate vector length</summary> /// <summary>Calculate vector length</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Length(Vector2 v); public static extern float Vector2Length(Vector2 v);
/// <summary>Calculate vector square length</summary> /// <summary>Calculate vector square length</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2LengthSqr(Vector2 v); public static extern float Vector2LengthSqr(Vector2 v);
/// <summary>Calculate two vectors dot product</summary> /// <summary>Calculate two vectors dot product</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2); public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2);
/// <summary>Calculate distance between two vectors</summary> /// <summary>Calculate distance between two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Distance(Vector2 v1, Vector2 v2); public static extern float Vector2Distance(Vector2 v1, Vector2 v2);
/// <summary>Calculate square distance between two vectors</summary> /// <summary>Calculate square distance between two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2DistanceSqr(Vector2 v1, Vector2 v2); public static extern float Vector2DistanceSqr(Vector2 v1, Vector2 v2);
/// <summary> /// <summary>
/// Calculate angle between two vectors /// Calculate angle between two vectors
/// NOTE: Angle is calculated from origin point (0, 0) /// NOTE: Angle is calculated from origin point (0, 0)
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2Angle(Vector2 v1, Vector2 v2); public static extern float Vector2Angle(Vector2 v1, Vector2 v2);
/// <summary> /// <summary>
@@ -109,142 +109,142 @@ namespace Raylib_cs
/// NOTE: Parameters need to be normalized /// NOTE: Parameters need to be normalized
/// Current implementation should be aligned with glm::angle /// Current implementation should be aligned with glm::angle
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector2LineAngle(Vector2 start, Vector2 end); public static extern float Vector2LineAngle(Vector2 start, Vector2 end);
/// <summary>Scale vector (multiply by value)</summary> /// <summary>Scale vector (multiply by value)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Scale(Vector2 v, float scale); public static extern Vector2 Vector2Scale(Vector2 v, float scale);
/// <summary>Multiply vector by vector</summary> /// <summary>Multiply vector by vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Multiply(Vector2 v1, Vector2 v2); public static extern Vector2 Vector2Multiply(Vector2 v1, Vector2 v2);
/// <summary>Negate vector</summary> /// <summary>Negate vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Negate(Vector2 v); public static extern Vector2 Vector2Negate(Vector2 v);
/// <summary>Divide vector by vector</summary> /// <summary>Divide vector by vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Divide(Vector2 v1, Vector2 v2); public static extern Vector2 Vector2Divide(Vector2 v1, Vector2 v2);
/// <summary>Normalize provided vector</summary> /// <summary>Normalize provided vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Normalize(Vector2 v); public static extern Vector2 Vector2Normalize(Vector2 v);
/// <summary>Transforms a Vector2 by a given Matrix</summary> /// <summary>Transforms a Vector2 by a given Matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Transform(Vector2 v, Matrix4x4 mat); public static extern Vector2 Vector2Transform(Vector2 v, Matrix4x4 mat);
/// <summary>Calculate linear interpolation between two vectors</summary> /// <summary>Calculate linear interpolation between two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount); public static extern Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount);
/// <summary>Calculate reflected vector to normal</summary> /// <summary>Calculate reflected vector to normal</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Reflect(Vector2 v, Vector2 normal); public static extern Vector2 Vector2Reflect(Vector2 v, Vector2 normal);
/// <summary>Rotate vector by angle</summary> /// <summary>Rotate vector by angle</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Rotate(Vector2 v, float angle); public static extern Vector2 Vector2Rotate(Vector2 v, float angle);
/// <summary>Move Vector towards target</summary> /// <summary>Move Vector towards target</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance); public static extern Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance);
/// <summary>Invert the given vector</summary> /// <summary>Invert the given vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Invert(Vector2 v); public static extern Vector2 Vector2Invert(Vector2 v);
/// <summary> /// <summary>
/// Clamp the components of the vector between min and max values specified by the given vectors /// Clamp the components of the vector between min and max values specified by the given vectors
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max); public static extern Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max);
/// <summary>Clamp the magnitude of the vector between two min and max values</summary> /// <summary>Clamp the magnitude of the vector between two min and max values</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector2ClampValue(Vector2 v, float min, float max); public static extern Vector2 Vector2ClampValue(Vector2 v, float min, float max);
/// <summary>Check whether two given vectors are almost equal</summary> /// <summary>Check whether two given vectors are almost equal</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int Vector2Equals(Vector2 p, Vector2 q); public static extern int Vector2Equals(Vector2 p, Vector2 q);
/// <summary>Vector with components value 0.0f</summary> /// <summary>Vector with components value 0.0f</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Zero(); public static extern Vector3 Vector3Zero();
/// <summary>Vector with components value 1.0f</summary> /// <summary>Vector with components value 1.0f</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3One(); public static extern Vector3 Vector3One();
/// <summary>Add two vectors</summary> /// <summary>Add two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2);
/// <summary>Add vector and float value</summary> /// <summary>Add vector and float value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3AddValue(Vector3 v, float add); public static extern Vector3 Vector3AddValue(Vector3 v, float add);
/// <summary>Subtract two vectors</summary> /// <summary>Subtract two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2);
/// <summary>Subtract vector and float value</summary> /// <summary>Subtract vector and float value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3SubtractValue(Vector3 v, float sub); public static extern Vector3 Vector3SubtractValue(Vector3 v, float sub);
/// <summary>Multiply vector by scalar</summary> /// <summary>Multiply vector by scalar</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Scale(Vector3 v, float scalar); public static extern Vector3 Vector3Scale(Vector3 v, float scalar);
/// <summary>Multiply vector by vector</summary> /// <summary>Multiply vector by vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Multiply(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Multiply(Vector3 v1, Vector3 v2);
/// <summary>Calculate two vectors cross product</summary> /// <summary>Calculate two vectors cross product</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2);
/// <summary>Calculate one vector perpendicular vector</summary> /// <summary>Calculate one vector perpendicular vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Perpendicular(Vector3 v); public static extern Vector3 Vector3Perpendicular(Vector3 v);
/// <summary>Calculate vector length</summary> /// <summary>Calculate vector length</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3Length(Vector3 v); public static extern float Vector3Length(Vector3 v);
/// <summary>Calculate vector square length</summary> /// <summary>Calculate vector square length</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3LengthSqr(Vector3 v); public static extern float Vector3LengthSqr(Vector3 v);
/// <summary>Calculate two vectors dot product</summary> /// <summary>Calculate two vectors dot product</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2); public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2);
/// <summary>Calculate distance between two vectors</summary> /// <summary>Calculate distance between two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3Distance(Vector3 v1, Vector3 v2); public static extern float Vector3Distance(Vector3 v1, Vector3 v2);
/// <summary>Calculate square distance between two vectors</summary> /// <summary>Calculate square distance between two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float Vector3DistanceSqr(Vector3 v1, Vector3 v2); public static extern float Vector3DistanceSqr(Vector3 v1, Vector3 v2);
/// <summary>Calculate angle between two vectors in XY and XZ</summary> /// <summary>Calculate angle between two vectors in XY and XZ</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 Vector3Angle(Vector3 v1, Vector3 v2); public static extern Vector2 Vector3Angle(Vector3 v1, Vector3 v2);
/// <summary>Negate provided vector (invert direction)</summary> /// <summary>Negate provided vector (invert direction)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Negate(Vector3 v); public static extern Vector3 Vector3Negate(Vector3 v);
/// <summary>Divide vector by vector</summary> /// <summary>Divide vector by vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Divide(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Divide(Vector3 v1, Vector3 v2);
/// <summary>Normalize provided vector</summary> /// <summary>Normalize provided vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Normalize(Vector3 v); public static extern Vector3 Vector3Normalize(Vector3 v);
/// <summary> /// <summary>
@@ -252,72 +252,72 @@ namespace Raylib_cs
/// Makes vectors normalized and orthogonal to each other<br/> /// Makes vectors normalized and orthogonal to each other<br/>
/// Gram-Schmidt function implementation /// Gram-Schmidt function implementation
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void Vector3OrthoNormalize(Vector3* v1, Vector3* v2); public static extern void Vector3OrthoNormalize(Vector3* v1, Vector3* v2);
/// <summary>Transforms a Vector3 by a given Matrix</summary> /// <summary>Transforms a Vector3 by a given Matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Transform(Vector3 v, Matrix4x4 mat); public static extern Vector3 Vector3Transform(Vector3 v, Matrix4x4 mat);
/// <summary>Transform a vector by quaternion rotation</summary> /// <summary>Transform a vector by quaternion rotation</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q); public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);
/// <summary>Rotates a vector around an axis</summary> /// <summary>Rotates a vector around an axis</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle); public static extern Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle);
/// <summary>Calculate linear interpolation between two vectors</summary> /// <summary>Calculate linear interpolation between two vectors</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount); public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);
/// <summary>Calculate reflected vector to normal</summary> /// <summary>Calculate reflected vector to normal</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal); public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal);
/// <summary>Get min value for each pair of components</summary> /// <summary>Get min value for each pair of components</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2);
/// <summary>Get max value for each pair of components</summary> /// <summary>Get max value for each pair of components</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Max(Vector3 v1, Vector3 v2); public static extern Vector3 Vector3Max(Vector3 v1, Vector3 v2);
/// <summary> /// <summary>
/// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c)<br/> /// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c)<br/>
/// NOTE: Assumes P is on the plane of the triangle /// NOTE: Assumes P is on the plane of the triangle
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c); public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c);
/// <summary> /// <summary>
/// Projects a Vector3 from screen space into object space<br/> /// Projects a Vector3 from screen space into object space<br/>
/// NOTE: We are avoiding calling other raymath functions despite available /// NOTE: We are avoiding calling other raymath functions despite available
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Unproject(Vector3 source, Matrix4x4 projection, Matrix4x4 view); public static extern Vector3 Vector3Unproject(Vector3 source, Matrix4x4 projection, Matrix4x4 view);
/// <summary>Get Vector3 as float array</summary> /// <summary>Get Vector3 as float array</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float3 Vector3ToFloatV(Vector3 v); public static extern Float3 Vector3ToFloatV(Vector3 v);
/// <summary>Invert the given vector</summary> /// <summary>Invert the given vector</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Invert(Vector3 v); public static extern Vector3 Vector3Invert(Vector3 v);
/// <summary> /// <summary>
/// Clamp the components of the vector between /// Clamp the components of the vector between
/// min and max values specified by the given vectors /// min and max values specified by the given vectors
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max); public static extern Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max);
/// <summary>Clamp the magnitude of the vector between two values</summary> /// <summary>Clamp the magnitude of the vector between two values</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3ClampValue(Vector3 v, float min, float max); public static extern Vector3 Vector3ClampValue(Vector3 v, float min, float max);
/// <summary>Check whether two given vectors are almost equal</summary> /// <summary>Check whether two given vectors are almost equal</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int Vector3Equals(Vector3 p, Vector3 q); public static extern int Vector3Equals(Vector3 p, Vector3 q);
/// <summary> /// <summary>
@@ -328,82 +328,82 @@ namespace Raylib_cs
/// from where the ray comes to the refractive index of the medium /// from where the ray comes to the refractive index of the medium
/// on the other side of the surface /// on the other side of the surface
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 Vector3Refract(Vector3 v, Vector3 n, float r); public static extern Vector3 Vector3Refract(Vector3 v, Vector3 n, float r);
/// <summary>Compute matrix determinant</summary> /// <summary>Compute matrix determinant</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float MatrixDeterminant(Matrix4x4 mat); public static extern float MatrixDeterminant(Matrix4x4 mat);
/// <summary>Get the trace of the matrix (sum of the values along the diagonal)</summary> /// <summary>Get the trace of the matrix (sum of the values along the diagonal)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float MatrixTrace(Matrix4x4 mat); public static extern float MatrixTrace(Matrix4x4 mat);
/// <summary>Transposes provided matrix</summary> /// <summary>Transposes provided matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixTranspose(Matrix4x4 mat); public static extern Matrix4x4 MatrixTranspose(Matrix4x4 mat);
/// <summary>Invert provided matrix</summary> /// <summary>Invert provided matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixInvert(Matrix4x4 mat); public static extern Matrix4x4 MatrixInvert(Matrix4x4 mat);
/// <summary>Get identity matrix</summary> /// <summary>Get identity matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixIdentity(); public static extern Matrix4x4 MatrixIdentity();
/// <summary>Add two matrices</summary> /// <summary>Add two matrices</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixAdd(Matrix4x4 left, Matrix4x4 right); public static extern Matrix4x4 MatrixAdd(Matrix4x4 left, Matrix4x4 right);
/// <summary>Subtract two matrices (left - right)</summary> /// <summary>Subtract two matrices (left - right)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixSubtract(Matrix4x4 left, Matrix4x4 right); public static extern Matrix4x4 MatrixSubtract(Matrix4x4 left, Matrix4x4 right);
/// <summary> /// <summary>
/// Get two matrix multiplication<br/> /// Get two matrix multiplication<br/>
/// NOTE: When multiplying matrices... the order matters! /// NOTE: When multiplying matrices... the order matters!
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixMultiply(Matrix4x4 left, Matrix4x4 right); public static extern Matrix4x4 MatrixMultiply(Matrix4x4 left, Matrix4x4 right);
/// <summary>Get translation matrix</summary> /// <summary>Get translation matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixTranslate(float x, float y, float z); public static extern Matrix4x4 MatrixTranslate(float x, float y, float z);
/// <summary> /// <summary>
/// Create rotation matrix from axis and angle<br/> /// Create rotation matrix from axis and angle<br/>
/// NOTE: Angle should be provided in radians /// NOTE: Angle should be provided in radians
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixRotate(Vector3 axis, float angle); public static extern Matrix4x4 MatrixRotate(Vector3 axis, float angle);
/// <summary>Get x-rotation matrix (angle in radians)</summary> /// <summary>Get x-rotation matrix (angle in radians)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixRotateX(float angle); public static extern Matrix4x4 MatrixRotateX(float angle);
/// <summary>Get y-rotation matrix (angle in radians)</summary> /// <summary>Get y-rotation matrix (angle in radians)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixRotateY(float angle); public static extern Matrix4x4 MatrixRotateY(float angle);
/// <summary>Get z-rotation matrix (angle in radians)</summary> /// <summary>Get z-rotation matrix (angle in radians)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixRotateZ(float angle); public static extern Matrix4x4 MatrixRotateZ(float angle);
/// <summary>Get xyz-rotation matrix (angles in radians)</summary> /// <summary>Get xyz-rotation matrix (angles in radians)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixRotateXYZ(Vector3 ang); public static extern Matrix4x4 MatrixRotateXYZ(Vector3 ang);
/// <summary>Get zyx-rotation matrix (angles in radians)</summary> /// <summary>Get zyx-rotation matrix (angles in radians)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixRotateZYX(Vector3 ang); public static extern Matrix4x4 MatrixRotateZYX(Vector3 ang);
/// <summary>Get scaling matrix</summary> /// <summary>Get scaling matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixScale(float x, float y, float z); public static extern Matrix4x4 MatrixScale(float x, float y, float z);
/// <summary>Get perspective projection matrix</summary> /// <summary>Get perspective projection matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixFrustum( public static extern Matrix4x4 MatrixFrustum(
double left, double left,
double right, double right,
@@ -417,11 +417,11 @@ namespace Raylib_cs
/// Get perspective projection matrix<br/> /// Get perspective projection matrix<br/>
/// NOTE: Angle should be provided in radians /// NOTE: Angle should be provided in radians
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixPerspective(double fovy, double aspect, double near, double far); public static extern Matrix4x4 MatrixPerspective(double fovy, double aspect, double near, double far);
/// <summary>Get orthographic projection matrix</summary> /// <summary>Get orthographic projection matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixOrtho( public static extern Matrix4x4 MatrixOrtho(
double left, double left,
double right, double right,
@@ -432,113 +432,113 @@ namespace Raylib_cs
); );
/// <summary>Get camera look-at matrix (view matrix)</summary> /// <summary>Get camera look-at matrix (view matrix)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up); public static extern Matrix4x4 MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
/// <summary>Get float array of matrix data</summary> /// <summary>Get float array of matrix data</summary>
[DllImport(Raylib.nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(Raylib.NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float16 MatrixToFloatV(Matrix4x4 m); public static extern Float16 MatrixToFloatV(Matrix4x4 m);
/// <summary>Add 2 quaternions</summary> /// <summary>Add 2 quaternions</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionAdd(Quaternion q1, Quaternion q2); public static extern Quaternion QuaternionAdd(Quaternion q1, Quaternion q2);
/// <summary>Add quaternion and float value</summary> /// <summary>Add quaternion and float value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionAddValue(Quaternion q, float add); public static extern Quaternion QuaternionAddValue(Quaternion q, float add);
/// <summary>Subtract 2 quaternions</summary> /// <summary>Subtract 2 quaternions</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2); public static extern Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2);
/// <summary>Subtract quaternion and float value</summary> /// <summary>Subtract quaternion and float value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionSubtractValue(Quaternion q, float add); public static extern Quaternion QuaternionSubtractValue(Quaternion q, float add);
/// <summary>Get identity quaternion</summary> /// <summary>Get identity quaternion</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionIdentity(); public static extern Quaternion QuaternionIdentity();
/// <summary>Computes the length of a quaternion</summary> /// <summary>Computes the length of a quaternion</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float QuaternionLength(Quaternion q); public static extern float QuaternionLength(Quaternion q);
/// <summary>Normalize provided quaternion</summary> /// <summary>Normalize provided quaternion</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionNormalize(Quaternion q); public static extern Quaternion QuaternionNormalize(Quaternion q);
/// <summary>Invert provided quaternion</summary> /// <summary>Invert provided quaternion</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionInvert(Quaternion q); public static extern Quaternion QuaternionInvert(Quaternion q);
/// <summary>Calculate two quaternion multiplication</summary> /// <summary>Calculate two quaternion multiplication</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2); public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);
/// <summary>Scale quaternion by float value</summary> /// <summary>Scale quaternion by float value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionScale(Quaternion q, float mul); public static extern Quaternion QuaternionScale(Quaternion q, float mul);
/// <summary>Divide two quaternions</summary> /// <summary>Divide two quaternions</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionDivide(Quaternion q1, Quaternion q2); public static extern Quaternion QuaternionDivide(Quaternion q1, Quaternion q2);
/// <summary>Calculate linear interpolation between two quaternions</summary> /// <summary>Calculate linear interpolation between two quaternions</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount); public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);
/// <summary>Calculate slerp-optimized interpolation between two quaternions</summary> /// <summary>Calculate slerp-optimized interpolation between two quaternions</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount); public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);
/// <summary>Calculates spherical linear interpolation between two quaternions</summary> /// <summary>Calculates spherical linear interpolation between two quaternions</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount); public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
/// <summary>Calculate quaternion based on the rotation from one vector to another</summary> /// <summary>Calculate quaternion based on the rotation from one vector to another</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to); public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
/// <summary>Get a quaternion for a given rotation matrix</summary> /// <summary>Get a quaternion for a given rotation matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromMatrix(Matrix4x4 mat); public static extern Quaternion QuaternionFromMatrix(Matrix4x4 mat);
/// <summary>Get a matrix for a given quaternion</summary> /// <summary>Get a matrix for a given quaternion</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 QuaternionToMatrix(Quaternion q); public static extern Matrix4x4 QuaternionToMatrix(Quaternion q);
/// <summary> /// <summary>
/// Get rotation quaternion for an angle and axis<br/> /// Get rotation quaternion for an angle and axis<br/>
/// NOTE: angle must be provided in radians /// NOTE: angle must be provided in radians
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle); public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);
/// <summary>Get the rotation angle and axis for a given quaternion</summary> /// <summary>Get the rotation angle and axis for a given quaternion</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void QuaternionToAxisAngle(Quaternion q, Vector3* outAxis, float* outAngle); public static extern void QuaternionToAxisAngle(Quaternion q, Vector3* outAxis, float* outAngle);
/// <summary> /// <summary>
/// Get the quaternion equivalent to Euler angles<br/> /// Get the quaternion equivalent to Euler angles<br/>
/// NOTE: Rotation order is ZYX /// NOTE: Rotation order is ZYX
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionFromEuler(float pitch, float yaw, float roll); public static extern Quaternion QuaternionFromEuler(float pitch, float yaw, float roll);
/// <summary> /// <summary>
/// Get the Euler angles equivalent to quaternion (roll, pitch, yaw)<br/> /// Get the Euler angles equivalent to quaternion (roll, pitch, yaw)<br/>
/// NOTE: Angles are returned in a Vector3 struct in radians /// NOTE: Angles are returned in a Vector3 struct in radians
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 QuaternionToEuler(Quaternion q); public static extern Vector3 QuaternionToEuler(Quaternion q);
/// <summary>Transform a quaternion given a transformation matrix</summary> /// <summary>Transform a quaternion given a transformation matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Quaternion QuaternionTransform(Quaternion q, Matrix4x4 mat); public static extern Quaternion QuaternionTransform(Quaternion q, Matrix4x4 mat);
/// <summary>Check whether two given quaternions are almost equal</summary> /// <summary>Check whether two given quaternions are almost equal</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int QuaternionEquals(Quaternion p, Quaternion q); public static extern int QuaternionEquals(Quaternion p, Quaternion q);
} }
} }

View File

@@ -10,7 +10,7 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Used by DllImport to load the native library /// Used by DllImport to load the native library
/// </summary> /// </summary>
public const string nativeLibName = "raylib"; public const string NativeLibName = "raylib";
public const int DEFAULT_BATCH_BUFFER_ELEMENTS = 8192; public const int DEFAULT_BATCH_BUFFER_ELEMENTS = 8192;
public const int DEFAULT_BATCH_BUFFERS = 1; public const int DEFAULT_BATCH_BUFFERS = 1;
@@ -92,55 +92,55 @@ namespace Raylib_cs
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
/// <summary>Choose the current matrix to be transformed</summary> /// <summary>Choose the current matrix to be transformed</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlMatrixMode(int mode); public static extern void RlMatrixMode(int mode);
/// <inheritdoc cref="rlMatrixMode(int)"/> /// <inheritdoc cref="RlMatrixMode(int)"/>
public static void rlMatrixMode(MatrixMode mode) public static void RlMatrixMode(MatrixMode mode)
{ {
rlMatrixMode((int)mode); RlMatrixMode((int)mode);
} }
/// <summary>Push the current matrix to stack</summary> /// <summary>Push the current matrix to stack</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlPushMatrix(); public static extern void RlPushMatrix();
/// <summary>Pop lattest inserted matrix from stack</summary> /// <summary>Pop lattest inserted matrix from stack</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlPopMatrix(); public static extern void RlPopMatrix();
/// <summary>Reset current matrix to identity matrix</summary> /// <summary>Reset current matrix to identity matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlLoadIdentity(); public static extern void RlLoadIdentity();
/// <summary>Multiply the current matrix by a translation matrix</summary> /// <summary>Multiply the current matrix by a translation matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlTranslatef(float x, float y, float z); public static extern void RlTranslatef(float x, float y, float z);
/// <summary>Multiply the current matrix by a rotation matrix</summary> /// <summary>Multiply the current matrix by a rotation matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlRotatef(float angle, float x, float y, float z); public static extern void RlRotatef(float angle, float x, float y, float z);
/// <summary>Multiply the current matrix by a scaling matrix</summary> /// <summary>Multiply the current matrix by a scaling matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlScalef(float x, float y, float z); public static extern void RlScalef(float x, float y, float z);
/// <summary> /// <summary>
/// Multiply the current matrix by another matrix<br/> /// Multiply the current matrix by another matrix<br/>
/// Current Matrix can be set via <see cref="rlMatrixMode(int)"/> /// Current Matrix can be set via <see cref="RlMatrixMode(int)"/>
/// </summary> /// </summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlMultMatrixf(float* matf); public static extern void RlMultMatrixf(float* matf);
/// <inheritdoc cref="rlMultMatrixf(float*)"/> /// <inheritdoc cref="RlMultMatrixf"/>
public static void rlMultMatrixf(Matrix4x4 matf) public static void RlMultMatrixf(Matrix4x4 matf)
{ {
float16 f = Raymath.MatrixToFloatV(matf); Float16 f = Raymath.MatrixToFloatV(matf);
rlMultMatrixf(f.v); RlMultMatrixf(f.v);
} }
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlFrustum( public static extern void RlFrustum(
double left, double left,
double right, double right,
double bottom, double bottom,
@@ -149,8 +149,8 @@ namespace Raylib_cs
double zfar double zfar
); );
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlOrtho( public static extern void RlOrtho(
double left, double left,
double right, double right,
double bottom, double bottom,
@@ -160,8 +160,8 @@ namespace Raylib_cs
); );
/// <summary>Set the viewport area</summary> /// <summary>Set the viewport area</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlViewport(int x, int y, int width, int height); public static extern void RlViewport(int x, int y, int width, int height);
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
@@ -169,49 +169,49 @@ namespace Raylib_cs
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
/// <summary>Initialize drawing mode (how to organize vertex)</summary> /// <summary>Initialize drawing mode (how to organize vertex)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlBegin(int mode); public static extern void RlBegin(int mode);
public static void rlBegin(DrawMode mode) public static void RlBegin(DrawMode mode)
{ {
rlBegin((int)mode); RlBegin((int)mode);
} }
/// <summary>Finish vertex providing</summary> /// <summary>Finish vertex providing</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnd(); public static extern void RlEnd();
/// <summary>Define one vertex (position) - 2 int</summary> /// <summary>Define one vertex (position) - 2 int</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlVertex2i(int x, int y); public static extern void RlVertex2i(int x, int y);
/// <summary>Define one vertex (position) - 2 float</summary> /// <summary>Define one vertex (position) - 2 float</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlVertex2f(float x, float y); public static extern void RlVertex2f(float x, float y);
/// <summary>Define one vertex (position) - 3 float</summary> /// <summary>Define one vertex (position) - 3 float</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlVertex3f(float x, float y, float z); public static extern void RlVertex3f(float x, float y, float z);
/// <summary>Define one vertex (texture coordinate) - 2 float</summary> /// <summary>Define one vertex (texture coordinate) - 2 float</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlTexCoord2f(float x, float y); public static extern void RlTexCoord2f(float x, float y);
/// <summary>Define one vertex (normal) - 3 float</summary> /// <summary>Define one vertex (normal) - 3 float</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlNormal3f(float x, float y, float z); public static extern void RlNormal3f(float x, float y, float z);
/// <summary>Define one vertex (color) - 4 byte</summary> /// <summary>Define one vertex (color) - 4 byte</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlColor4ub(byte r, byte g, byte b, byte a); public static extern void RlColor4ub(byte r, byte g, byte b, byte a);
/// <summary>Define one vertex (color) - 3 float</summary> /// <summary>Define one vertex (color) - 3 float</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlColor3f(float x, float y, float z); public static extern void RlColor3f(float x, float y, float z);
/// <summary>Define one vertex (color) - 4 float</summary> /// <summary>Define one vertex (color) - 4 float</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlColor4f(float x, float y, float z, float w); public static extern void RlColor4f(float x, float y, float z, float w);
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
@@ -222,214 +222,214 @@ namespace Raylib_cs
/// <summary>Vertex buffers state</summary> /// <summary>Vertex buffers state</summary>
/// <summary>Enable vertex array (VAO, if supported)</summary> /// <summary>Enable vertex array (VAO, if supported)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern CBool rlEnableVertexArray(uint vaoId); public static extern CBool RlEnableVertexArray(uint vaoId);
/// <summary>Disable vertex array (VAO, if supported)</summary> /// <summary>Disable vertex array (VAO, if supported)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableVertexArray(); public static extern void RlDisableVertexArray();
/// <summary>Enable vertex buffer (VBO)</summary> /// <summary>Enable vertex buffer (VBO)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableVertexBuffer(uint id); public static extern void RlEnableVertexBuffer(uint id);
/// <summary>Disable vertex buffer (VBO)</summary> /// <summary>Disable vertex buffer (VBO)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableVertexBuffer(); public static extern void RlDisableVertexBuffer();
/// <summary>Enable vertex buffer element (VBO element)</summary> /// <summary>Enable vertex buffer element (VBO element)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableVertexBufferElement(uint id); public static extern void RlEnableVertexBufferElement(uint id);
/// <summary>Disable vertex buffer element (VBO element)</summary> /// <summary>Disable vertex buffer element (VBO element)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableVertexBufferElement(); public static extern void RlDisableVertexBufferElement();
/// <summary>Enable vertex attribute index</summary> /// <summary>Enable vertex attribute index</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableVertexAttribute(uint index); public static extern void RlEnableVertexAttribute(uint index);
/// <summary>Disable vertex attribute index</summary> /// <summary>Disable vertex attribute index</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableVertexAttribute(uint index); public static extern void RlDisableVertexAttribute(uint index);
/// <summary>Enable attribute state pointer<br/> /// <summary>Enable attribute state pointer<br/>
/// NOTE: Only available for GRAPHICS_API_OPENGL_11</summary> /// NOTE: Only available for GRAPHICS_API_OPENGL_11</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableStatePointer(int vertexAttribType, void* buffer); public static extern void RlEnableStatePointer(int vertexAttribType, void* buffer);
/// <summary>Disable attribute state pointer<br/> /// <summary>Disable attribute state pointer<br/>
/// NOTE: Only available for GRAPHICS_API_OPENGL_11</summary> /// NOTE: Only available for GRAPHICS_API_OPENGL_11</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableStatePointer(int vertexAttribType); public static extern void RlDisableStatePointer(int vertexAttribType);
// Textures state // Textures state
/// <summary>Select and active a texture slot</summary> /// <summary>Select and active a texture slot</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlActiveTextureSlot(int slot); public static extern void RlActiveTextureSlot(int slot);
/// <summary>Enable texture</summary> /// <summary>Enable texture</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableTexture(uint id); public static extern void RlEnableTexture(uint id);
/// <summary>Disable texture</summary> /// <summary>Disable texture</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableTexture(); public static extern void RlDisableTexture();
/// <summary>Enable texture cubemap</summary> /// <summary>Enable texture cubemap</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableTextureCubemap(uint id); public static extern void RlEnableTextureCubemap(uint id);
/// <summary>Disable texture cubemap</summary> /// <summary>Disable texture cubemap</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableTextureCubemap(); public static extern void RlDisableTextureCubemap();
/// <summary>Set texture parameters (filter, wrap)</summary> /// <summary>Set texture parameters (filter, wrap)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlTextureParameters(uint id, int param, int value); public static extern void RlTextureParameters(uint id, int param, int value);
/// <summary>Set cubemap parameters (filter, wrap)</summary> /// <summary>Set cubemap parameters (filter, wrap)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlCubemapParameters(uint id, int param, int value); public static extern void RlCubemapParameters(uint id, int param, int value);
// Shader state // Shader state
/// <summary>Enable shader program</summary> /// <summary>Enable shader program</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableShader(uint id); public static extern void RlEnableShader(uint id);
/// <summary>Disable shader program</summary> /// <summary>Disable shader program</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableShader(); public static extern void RlDisableShader();
// Framebuffer state // Framebuffer state
/// <summary>Enable render texture (fbo)</summary> /// <summary>Enable render texture (fbo)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableFramebuffer(uint id); public static extern void RlEnableFramebuffer(uint id);
/// <summary>Disable render texture (fbo), return to default framebuffer</summary> /// <summary>Disable render texture (fbo), return to default framebuffer</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableFramebuffer(); public static extern void RlDisableFramebuffer();
/// <summary>Activate multiple draw color buffers</summary> /// <summary>Activate multiple draw color buffers</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlActiveDrawBuffers(int count); public static extern void RlActiveDrawBuffers(int count);
// General render state // General render state
/// <summary>Enable color blending</summary> /// <summary>Enable color blending</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableColorBlend(); public static extern void RlEnableColorBlend();
/// <summary>Disable color blending</summary> /// <summary>Disable color blending</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableColorBlend(); public static extern void RlDisableColorBlend();
/// <summary>Enable depth test</summary> /// <summary>Enable depth test</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableDepthTest(); public static extern void RlEnableDepthTest();
/// <summary>Disable depth test</summary> /// <summary>Disable depth test</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableDepthTest(); public static extern void RlDisableDepthTest();
/// <summary>Enable depth write</summary> /// <summary>Enable depth write</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableDepthMask(); public static extern void RlEnableDepthMask();
/// <summary>Disable depth write</summary> /// <summary>Disable depth write</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableDepthMask(); public static extern void RlDisableDepthMask();
/// <summary>Enable backface culling</summary> /// <summary>Enable backface culling</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableBackfaceCulling(); public static extern void RlEnableBackfaceCulling();
/// <summary>Disable backface culling</summary> /// <summary>Disable backface culling</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableBackfaceCulling(); public static extern void RlDisableBackfaceCulling();
/// <summary>Set face culling mode</summary> /// <summary>Set face culling mode</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetCullFace(int mode); public static extern void RlSetCullFace(int mode);
/// <summary>Enable scissor test</summary> /// <summary>Enable scissor test</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableScissorTest(); public static extern void RlEnableScissorTest();
/// <summary>Disable scissor test</summary> /// <summary>Disable scissor test</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableScissorTest(); public static extern void RlDisableScissorTest();
/// <summary>Scissor test</summary> /// <summary>Scissor test</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlScissor(int x, int y, int width, int height); public static extern void RlScissor(int x, int y, int width, int height);
/// <summary>Enable wire mode</summary> /// <summary>Enable wire mode</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableWireMode(); public static extern void RlEnableWireMode();
/// <summary>Disable wire mode</summary> /// <summary>Disable wire mode</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableWireMode(); public static extern void RlDisableWireMode();
/// <summary>Set the line drawing width</summary> /// <summary>Set the line drawing width</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetLineWidth(float width); public static extern void RlSetLineWidth(float width);
/// <summary>Get the line drawing width</summary> /// <summary>Get the line drawing width</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern float rlGetLineWidth(); public static extern float RlGetLineWidth();
/// <summary>Enable line aliasing</summary> /// <summary>Enable line aliasing</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableSmoothLines(); public static extern void RlEnableSmoothLines();
/// <summary>Disable line aliasing</summary> /// <summary>Disable line aliasing</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableSmoothLines(); public static extern void RlDisableSmoothLines();
/// <summary>Enable stereo rendering</summary> /// <summary>Enable stereo rendering</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnableStereoRender(); public static extern void RlEnableStereoRender();
/// <summary>Disable stereo rendering</summary> /// <summary>Disable stereo rendering</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDisableStereoRender(); public static extern void RlDisableStereoRender();
/// <summary>Check if stereo render is enabled</summary> /// <summary>Check if stereo render is enabled</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern CBool rlIsStereoRenderEnabled(); public static extern CBool RlIsStereoRenderEnabled();
/// <summary>Clear color buffer with color</summary> /// <summary>Clear color buffer with color</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlClearColor(byte r, byte g, byte b, byte a); public static extern void RlClearColor(byte r, byte g, byte b, byte a);
/// <summary>Clear used screen buffers (color and depth)</summary> /// <summary>Clear used screen buffers (color and depth)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlClearScreenBuffers(); public static extern void RlClearScreenBuffers();
/// <summary>Check and log OpenGL error codes</summary> /// <summary>Check and log OpenGL error codes</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlCheckErrors(); public static extern void RlCheckErrors();
/// <summary>Set blending mode</summary> /// <summary>Set blending mode</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetBlendMode(BlendMode mode); public static extern void RlSetBlendMode(BlendMode mode);
/// <summary>Set blending mode factor and equation (using OpenGL factors)</summary> /// <summary>Set blending mode factor and equation (using OpenGL factors)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation); public static extern void RlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation);
/// <summary>Set blending mode factors and equations separately (using OpenGL factors)</summary> /// <summary>Set blending mode factors and equations separately (using OpenGL factors)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetBlendFactorsSeparate( public static extern void RlSetBlendFactorsSeparate(
int glSrcRGB, int glSrcRGB,
int glDstRGB, int glDstRGB,
int glSrcAlpha, int glSrcAlpha,
@@ -444,104 +444,104 @@ namespace Raylib_cs
// ------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------
/// <summary>Initialize rlgl (buffers, shaders, textures, states)</summary> /// <summary>Initialize rlgl (buffers, shaders, textures, states)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlglInit(int width, int height); public static extern void RlGlInit(int width, int height);
/// <summary>De-inititialize rlgl (buffers, shaders, textures)</summary> /// <summary>De-inititialize rlgl (buffers, shaders, textures)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlglClose(); public static extern void RlGlClose();
/// <summary>Load OpenGL extensions</summary> /// <summary>Load OpenGL extensions</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlLoadExtensions(void* loader); public static extern void RlLoadExtensions(void* loader);
/// <summary>Get current OpenGL version</summary> /// <summary>Get current OpenGL version</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern GlVersion rlGetVersion(); public static extern GlVersion RlGetVersion();
/// <summary>Get default framebuffer width</summary> /// <summary>Get default framebuffer width</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int rlGetFramebufferWidth(); public static extern int RlGetFramebufferWidth();
/// <summary>Get default framebuffer height</summary> /// <summary>Get default framebuffer height</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int rlGetFramebufferHeight(); public static extern int RlGetFramebufferHeight();
/// <summary>Get default texture</summary> /// <summary>Get default texture</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlGetTextureIdDefault(); public static extern uint RlGetTextureIdDefault();
/// <summary>Get default shader</summary> /// <summary>Get default shader</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlGetShaderIdDefault(); public static extern uint RlGetShaderIdDefault();
/// <summary>Get default shader locations</summary> /// <summary>Get default shader locations</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int* rlGetShaderLocsDefault(); public static extern int* RlGetShaderLocsDefault();
// Render batch management // Render batch management
/// <summary>Load a render batch system<br/> /// <summary>Load a render batch system<br/>
/// NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode<br/> /// NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode<br/>
/// but this render batch API is exposed in case custom batches are required</summary> /// but this render batch API is exposed in case custom batches are required</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern RenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements); public static extern RenderBatch RlLoadRenderBatch(int numBuffers, int bufferElements);
/// <summary>Unload render batch system</summary> /// <summary>Unload render batch system</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUnloadRenderBatch(RenderBatch batch); public static extern void RlUnloadRenderBatch(RenderBatch batch);
/// <summary>Draw render batch data (Update->Draw->Reset)</summary> /// <summary>Draw render batch data (Update->Draw->Reset)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDrawRenderBatch(RenderBatch* batch); public static extern void RlDrawRenderBatch(RenderBatch* batch);
/// <summary>Set the active render batch for rlgl (NULL for default internal)</summary> /// <summary>Set the active render batch for rlgl (NULL for default internal)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetRenderBatchActive(RenderBatch* batch); public static extern void RlSetRenderBatchActive(RenderBatch* batch);
/// <summary>Update and draw internal render batch</summary> /// <summary>Update and draw internal render batch</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDrawRenderBatchActive(); public static extern void RlDrawRenderBatchActive();
/// <summary>Check internal buffer overflow for a given number of vertex</summary> /// <summary>Check internal buffer overflow for a given number of vertex</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern CBool rlCheckRenderBatchLimit(int vCount); public static extern CBool RlCheckRenderBatchLimit(int vCount);
/// <summary>Set current texture for render batch and check buffers limits</summary> /// <summary>Set current texture for render batch and check buffers limits</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetTexture(uint id); public static extern void RlSetTexture(uint id);
// Vertex buffers management // Vertex buffers management
/// <summary>Load vertex array (vao) if supported</summary> /// <summary>Load vertex array (vao) if supported</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadVertexArray(); public static extern uint RlLoadVertexArray();
/// <summary>Load a vertex buffer attribute</summary> /// <summary>Load a vertex buffer attribute</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadVertexBuffer(void* buffer, int size, CBool dynamic); public static extern uint RlLoadVertexBuffer(void* buffer, int size, CBool dynamic);
/// <summary>Load a new attributes element buffer</summary> /// <summary>Load a new attributes element buffer</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadVertexBufferElement(void* buffer, int size, CBool dynamic); public static extern uint RlLoadVertexBufferElement(void* buffer, int size, CBool dynamic);
/// <summary>Update GPU buffer with new data</summary> /// <summary>Update GPU buffer with new data</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUpdateVertexBuffer(uint bufferId, void* data, int dataSize, int offset); public static extern void RlUpdateVertexBuffer(uint bufferId, void* data, int dataSize, int offset);
/// <summary>Update vertex buffer elements with new data</summary> /// <summary>Update vertex buffer elements with new data</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUpdateVertexBufferElements(uint id, void* data, int dataSize, int offset); public static extern void RlUpdateVertexBufferElements(uint id, void* data, int dataSize, int offset);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUnloadVertexArray(uint vaoId); public static extern void RlUnloadVertexArray(uint vaoId);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUnloadVertexBuffer(uint vboId); public static extern void RlUnloadVertexBuffer(uint vboId);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetVertexAttribute( public static extern void RlSetVertexAttribute(
uint index, uint index,
int compSize, int compSize,
int type, int type,
@@ -550,24 +550,24 @@ namespace Raylib_cs
void* pointer void* pointer
); );
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetVertexAttributeDivisor(uint index, int divisor); public static extern void RlSetVertexAttributeDivisor(uint index, int divisor);
/// <summary>Set vertex attribute default value</summary> /// <summary>Set vertex attribute default value</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetVertexAttributeDefault(int locIndex, void* value, int attribType, int count); public static extern void RlSetVertexAttributeDefault(int locIndex, void* value, int attribType, int count);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDrawVertexArray(int offset, int count); public static extern void RlDrawVertexArray(int offset, int count);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDrawVertexArrayElements(int offset, int count, void* buffer); public static extern void RlDrawVertexArrayElements(int offset, int count, void* buffer);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDrawVertexArrayInstanced(int offset, int count, int instances); public static extern void RlDrawVertexArrayInstanced(int offset, int count, int instances);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlDrawVertexArrayElementsInstanced( public static extern void RlDrawVertexArrayElementsInstanced(
int offset, int offset,
int count, int count,
void* buffer, void* buffer,
@@ -578,20 +578,20 @@ namespace Raylib_cs
// Textures data management // Textures data management
/// <summary>Load texture in GPU</summary> /// <summary>Load texture in GPU</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadTexture(void* data, int width, int height, PixelFormat format, int mipmapCount); public static extern uint RlLoadTexture(void* data, int width, int height, PixelFormat format, int mipmapCount);
/// <summary>Load depth texture/renderbuffer (to be attached to fbo)</summary> /// <summary>Load depth texture/renderbuffer (to be attached to fbo)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadTextureDepth(int width, int height, CBool useRenderBuffer); public static extern uint RlLoadTextureDepth(int width, int height, CBool useRenderBuffer);
/// <summary>Load texture cubemap</summary> /// <summary>Load texture cubemap</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadTextureCubemap(void* data, int size, PixelFormat format); public static extern uint RlLoadTextureCubemap(void* data, int size, PixelFormat format);
/// <summary>Update GPU texture with new data</summary> /// <summary>Update GPU texture with new data</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUpdateTexture( public static extern void RlUpdateTexture(
uint id, uint id,
int offsetX, int offsetX,
int offsetY, int offsetY,
@@ -602,8 +602,8 @@ namespace Raylib_cs
); );
/// <summary>Get OpenGL internal formats</summary> /// <summary>Get OpenGL internal formats</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlGetGlTextureFormats( public static extern void RlGetGlTextureFormats(
PixelFormat format, PixelFormat format,
int* glInternalFormat, int* glInternalFormat,
int* glFormat, int* glFormat,
@@ -611,35 +611,35 @@ namespace Raylib_cs
); );
/// <summary>Get OpenGL internal formats</summary> /// <summary>Get OpenGL internal formats</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte* rlGetPixelFormatName(PixelFormat format); public static extern sbyte* RlGetPixelFormatName(PixelFormat format);
/// <summary>Unload texture from GPU memory</summary> /// <summary>Unload texture from GPU memory</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUnloadTexture(uint id); public static extern void RlUnloadTexture(uint id);
/// <summary>Generate mipmap data for selected texture</summary> /// <summary>Generate mipmap data for selected texture</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlGenTextureMipmaps(uint id, int width, int height, PixelFormat format, int* mipmaps); public static extern void RlGenTextureMipmaps(uint id, int width, int height, PixelFormat format, int* mipmaps);
/// <summary>Read texture pixel data</summary> /// <summary>Read texture pixel data</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void* rlReadTexturePixels(uint id, int width, int height, PixelFormat format); public static extern void* RlReadTexturePixels(uint id, int width, int height, PixelFormat format);
/// <summary>Read screen pixel data (color buffer)</summary> /// <summary>Read screen pixel data (color buffer)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern byte* rlReadScreenPixels(int width, int height); public static extern byte* RlReadScreenPixels(int width, int height);
// Framebuffer management (fbo) // Framebuffer management (fbo)
/// <summary>Load an empty framebuffer</summary> /// <summary>Load an empty framebuffer</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadFramebuffer(int width, int height); public static extern uint RlLoadFramebuffer(int width, int height);
/// <summary>Attach texture/renderbuffer to a framebuffer</summary> /// <summary>Attach texture/renderbuffer to a framebuffer</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlFramebufferAttach( public static extern void RlFramebufferAttach(
uint fboId, uint fboId,
uint texId, uint texId,
FramebufferAttachType attachType, FramebufferAttachType attachType,
@@ -648,94 +648,94 @@ namespace Raylib_cs
); );
/// <summary>Verify framebuffer is complete</summary> /// <summary>Verify framebuffer is complete</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern CBool rlFramebufferComplete(uint id); public static extern CBool RlFramebufferComplete(uint id);
/// <summary>Delete framebuffer from GPU</summary> /// <summary>Delete framebuffer from GPU</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUnloadFramebuffer(uint id); public static extern void RlUnloadFramebuffer(uint id);
// Shaders management // Shaders management
/// <summary>Load shader from code strings</summary> /// <summary>Load shader from code strings</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadShaderCode(sbyte* vsCode, sbyte* fsCode); public static extern uint RlLoadShaderCode(sbyte* vsCode, sbyte* fsCode);
/// <summary>Compile custom shader and return shader id<br/> /// <summary>Compile custom shader and return shader id<br/>
/// (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)</summary> /// (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlCompileShader(sbyte* shaderCode, int type); public static extern uint RlCompileShader(sbyte* shaderCode, int type);
/// <summary>Load custom shader program</summary> /// <summary>Load custom shader program</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadShaderProgram(uint vShaderId, uint fShaderId); public static extern uint RlLoadShaderProgram(uint vShaderId, uint fShaderId);
/// <summary>Unload shader program</summary> /// <summary>Unload shader program</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUnloadShaderProgram(uint id); public static extern void RlUnloadShaderProgram(uint id);
/// <summary>Get shader location uniform</summary> /// <summary>Get shader location uniform</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int rlGetLocationUniform(uint shaderId, sbyte* uniformName); public static extern int RlGetLocationUniform(uint shaderId, sbyte* uniformName);
/// <summary>Get shader location attribute</summary> /// <summary>Get shader location attribute</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int rlGetLocationAttrib(uint shaderId, sbyte* attribName); public static extern int RlGetLocationAttrib(uint shaderId, sbyte* attribName);
/// <summary>Set shader value uniform</summary> /// <summary>Set shader value uniform</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetUniform(int locIndex, void* value, int uniformType, int count); public static extern void RlSetUniform(int locIndex, void* value, int uniformType, int count);
/// <summary>Set shader value matrix</summary> /// <summary>Set shader value matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetUniformMatrix(int locIndex, Matrix4x4 mat); public static extern void RlSetUniformMatrix(int locIndex, Matrix4x4 mat);
/// <summary>Set shader value sampler</summary> /// <summary>Set shader value sampler</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetUniformSampler(int locIndex, uint textureId); public static extern void RlSetUniformSampler(int locIndex, uint textureId);
/// <summary>Set shader currently active (id and locations)</summary> /// <summary>Set shader currently active (id and locations)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetShader(uint id, int* locs); public static extern void RlSetShader(uint id, int* locs);
// Compute shader management // Compute shader management
/// <summary>Load compute shader program</summary> /// <summary>Load compute shader program</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadComputeShaderProgram(uint shaderId); public static extern uint RlLoadComputeShaderProgram(uint shaderId);
/// <summary>Dispatch compute shader (equivalent to *draw* for graphics pilepine)</summary> /// <summary>Dispatch compute shader (equivalent to *draw* for graphics pilepine)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlComputeShaderDispatch(uint groupX, uint groupY, uint groupZ); public static extern void RlComputeShaderDispatch(uint groupX, uint groupY, uint groupZ);
// Shader buffer storage object management (ssbo) // Shader buffer storage object management (ssbo)
/// <summary>Load shader storage buffer object (SSBO)</summary> /// <summary>Load shader storage buffer object (SSBO)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlLoadShaderBuffer(uint size, void* data, int usageHint); public static extern uint RlLoadShaderBuffer(uint size, void* data, int usageHint);
/// <summary>Unload shader storage buffer object (SSBO)</summary> /// <summary>Unload shader storage buffer object (SSBO)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUnloadShaderBuffer(uint ssboId); public static extern void RlUnloadShaderBuffer(uint ssboId);
/// <summary>Update SSBO buffer data</summary> /// <summary>Update SSBO buffer data</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlUpdateShaderBuffer(uint id, void* data, uint dataSize, uint offset); public static extern void RlUpdateShaderBuffer(uint id, void* data, uint dataSize, uint offset);
/// <summary>Bind SSBO buffer data</summary> /// <summary>Bind SSBO buffer data</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlBindShaderBuffer(uint id, uint index); public static extern void RlBindShaderBuffer(uint id, uint index);
/// <summary>Read SSBO buffer data (GPU->CPU)</summary> /// <summary>Read SSBO buffer data (GPU->CPU)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlReadShaderBuffer(uint id, void* dest, uint count, uint offset); public static extern void RlReadShaderBuffer(uint id, void* dest, uint count, uint offset);
/// <summary>Copy SSBO data between buffers</summary> /// <summary>Copy SSBO data between buffers</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlCopyShaderBuffer( public static extern void RlCopyShaderBuffer(
uint destId, uint destId,
uint srcId, uint srcId,
uint destOffset, uint destOffset,
@@ -744,64 +744,64 @@ namespace Raylib_cs
); );
/// <summary>Get SSBO buffer size</summary> /// <summary>Get SSBO buffer size</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern uint rlGetShaderBufferSize(uint id); public static extern uint RlGetShaderBufferSize(uint id);
// Buffer management // Buffer management
/// <summary>Bind image texture</summary> /// <summary>Bind image texture</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlBindImageTexture(uint id, uint index, int format, CBool readOnly); public static extern void RlBindImageTexture(uint id, uint index, int format, CBool readOnly);
// Matrix state management // Matrix state management
/// <summary>Get internal modelview matrix</summary> /// <summary>Get internal modelview matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 rlGetMatrixModelview(); public static extern Matrix4x4 RlGetMatrixModelView();
/// <summary>Get internal projection matrix</summary> /// <summary>Get internal projection matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 rlGetMatrixProjection(); public static extern Matrix4x4 RlGetMatrixProjection();
/// <summary>Get internal accumulated transform matrix</summary> /// <summary>Get internal accumulated transform matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 rlGetMatrixTransform(); public static extern Matrix4x4 RlGetMatrixTransform();
/// <summary>Get internal projection matrix for stereo render (selected eye)</summary> /// <summary>Get internal projection matrix for stereo render (selected eye)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 rlGetMatrixProjectionStereo(int eye); public static extern Matrix4x4 RlGetMatrixProjectionStereo(int eye);
/// <summary>Get internal view offset matrix for stereo render (selected eye)</summary> /// <summary>Get internal view offset matrix for stereo render (selected eye)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 rlGetMatrixViewOffsetStereo(int eye); public static extern Matrix4x4 RlGetMatrixViewOffsetStereo(int eye);
/// <summary>Set a custom projection matrix (replaces internal projection matrix)</summary> /// <summary>Set a custom projection matrix (replaces internal projection matrix)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetMatrixProjection(Matrix4x4 view); public static extern void RlSetMatrixProjection(Matrix4x4 view);
/// <summary>Set a custom modelview matrix (replaces internal modelview matrix)</summary> /// <summary>Set a custom modelview matrix (replaces internal modelview matrix)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetMatrixModelview(Matrix4x4 proj); public static extern void RlSetMatrixModelView(Matrix4x4 proj);
/// <summary>Set eyes projection matrices for stereo rendering</summary> /// <summary>Set eyes projection matrices for stereo rendering</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetMatrixProjectionStereo(Matrix4x4 left, Matrix4x4 right); public static extern void RlSetMatrixProjectionStereo(Matrix4x4 left, Matrix4x4 right);
/// <summary>Set eyes view offsets matrices for stereo rendering</summary> /// <summary>Set eyes view offsets matrices for stereo rendering</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetMatrixViewOffsetStereo(Matrix4x4 left, Matrix4x4 right); public static extern void RlSetMatrixViewOffsetStereo(Matrix4x4 left, Matrix4x4 right);
// Quick and dirty cube/quad buffers load->draw->unload // Quick and dirty cube/quad buffers load->draw->unload
/// <summary>Load and draw a cube</summary> /// <summary>Load and draw a cube</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlLoadDrawCube(); public static extern void RlLoadDrawCube();
/// <summary>Load and draw a quad</summary> /// <summary>Load and draw a quad</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlLoadDrawQuad(); public static extern void RlLoadDrawQuad();
} }
} }

View File

@@ -12,28 +12,28 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Number of samples /// Number of samples
/// </summary> /// </summary>
public uint sampleCount; public uint SampleCount;
/// <summary> /// <summary>
/// Frequency (samples per second) /// Frequency (samples per second)
/// </summary> /// </summary>
public uint sampleRate; public uint SampleRate;
/// <summary> /// <summary>
/// Bit depth (bits per sample): 8, 16, 32 (24 not supported) /// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
/// </summary> /// </summary>
public uint sampleSize; public uint SampleSize;
/// <summary> /// <summary>
/// Number of channels (1-mono, 2-stereo) /// Number of channels (1-mono, 2-stereo)
/// </summary> /// </summary>
public uint channels; public uint Channels;
//TODO: SPAN<byte> ? //TODO: SPAN<byte> ?
/// <summary> /// <summary>
/// Buffer data pointer /// Buffer data pointer
/// </summary> /// </summary>
public void* data; public void* Data;
} }
/// <summary> /// <summary>
@@ -47,27 +47,27 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Pointer to internal data(rAudioBuffer *) used by the audio system /// Pointer to internal data(rAudioBuffer *) used by the audio system
/// </summary> /// </summary>
public IntPtr buffer; public IntPtr Buffer;
/// <summary> /// <summary>
/// Pointer to internal data processor, useful for audio effects /// Pointer to internal data processor, useful for audio effects
/// </summary> /// </summary>
public IntPtr processor; public IntPtr Processor;
/// <summary> /// <summary>
/// Frequency (samples per second) /// Frequency (samples per second)
/// </summary> /// </summary>
public uint sampleRate; public uint SampleRate;
/// <summary> /// <summary>
/// Bit depth (bits per sample): 8, 16, 32 (24 not supported) /// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
/// </summary> /// </summary>
public uint sampleSize; public uint SampleSize;
/// <summary> /// <summary>
/// Number of channels (1-mono, 2-stereo) /// Number of channels (1-mono, 2-stereo)
/// </summary> /// </summary>
public uint channels; public uint Channels;
} }
/// <summary> /// <summary>
@@ -79,12 +79,12 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Audio stream /// Audio stream
/// </summary> /// </summary>
public AudioStream stream; public AudioStream Stream;
/// <summary> /// <summary>
/// Total number of frames (considering channels) /// Total number of frames (considering channels)
/// </summary> /// </summary>
public uint frameCount; public uint FrameCount;
} }
/// <summary> /// <summary>
@@ -97,27 +97,27 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Audio stream /// Audio stream
/// </summary> /// </summary>
public AudioStream stream; public AudioStream Stream;
/// <summary> /// <summary>
/// Total number of samples /// Total number of samples
/// </summary> /// </summary>
public uint frameCount; public uint FrameCount;
/// <summary> /// <summary>
/// Music looping enable /// Music looping enable
/// </summary> /// </summary>
public CBool looping; public CBool Looping;
/// <summary> /// <summary>
/// Type of music context (audio filetype) /// Type of music context (audio filetype)
/// </summary> /// </summary>
public int ctxType; public int CtxType;
//TODO span //TODO span
/// <summary> /// <summary>
/// Audio context data, depends on type /// Audio context data, depends on type
/// </summary> /// </summary>
public void* ctxData; public void* CtxData;
} }
} }

View File

@@ -10,17 +10,17 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Minimum vertex box-corner /// Minimum vertex box-corner
/// </summary> /// </summary>
public Vector3 min; public Vector3 Min;
/// <summary> /// <summary>
/// Maximum vertex box-corner /// Maximum vertex box-corner
/// </summary> /// </summary>
public Vector3 max; public Vector3 Max;
public BoundingBox(Vector3 min, Vector3 max) public BoundingBox(Vector3 min, Vector3 max)
{ {
this.min = min; this.Min = min;
this.max = max; this.Max = max;
} }
} }
} }

View File

@@ -12,29 +12,29 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Camera offset (displacement from target) /// Camera offset (displacement from target)
/// </summary> /// </summary>
public Vector2 offset; public Vector2 Offset;
/// <summary> /// <summary>
/// Camera target (rotation and zoom origin) /// Camera target (rotation and zoom origin)
/// </summary> /// </summary>
public Vector2 target; public Vector2 Target;
/// <summary> /// <summary>
/// Camera rotation in degrees /// Camera rotation in degrees
/// </summary> /// </summary>
public float rotation; public float Rotation;
/// <summary> /// <summary>
/// Camera zoom (scaling), should be 1.0f by default /// Camera zoom (scaling), should be 1.0f by default
/// </summary> /// </summary>
public float zoom; public float Zoom;
public Camera2D(Vector2 offset, Vector2 target, float rotation, float zoom) public Camera2D(Vector2 offset, Vector2 target, float rotation, float zoom)
{ {
this.offset = offset; this.Offset = offset;
this.target = target; this.Target = target;
this.rotation = rotation; this.Rotation = rotation;
this.zoom = zoom; this.Zoom = zoom;
} }
} }
} }

View File

@@ -33,35 +33,35 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Camera position /// Camera position
/// </summary> /// </summary>
public Vector3 position; public Vector3 Position;
/// <summary> /// <summary>
/// Camera target it looks-at /// Camera target it looks-at
/// </summary> /// </summary>
public Vector3 target; public Vector3 Target;
/// <summary> /// <summary>
/// Camera up vector (rotation over its axis) /// Camera up vector (rotation over its axis)
/// </summary> /// </summary>
public Vector3 up; public Vector3 Up;
/// <summary> /// <summary>
/// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic /// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
/// </summary> /// </summary>
public float fovy; public float FovY;
/// <summary> /// <summary>
/// Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC /// Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
/// </summary> /// </summary>
public CameraProjection projection; public CameraProjection Projection;
public Camera3D(Vector3 position, Vector3 target, Vector3 up, float fovy, CameraProjection projection) public Camera3D(Vector3 position, Vector3 target, Vector3 up, float fovY, CameraProjection projection)
{ {
this.position = position; this.Position = position;
this.target = target; this.Target = target;
this.up = up; this.Up = up;
this.fovy = fovy; this.FovY = fovY;
this.projection = projection; this.Projection = projection;
} }
} }
} }

View File

@@ -9,10 +9,10 @@ namespace Raylib_cs
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct Color public partial struct Color
{ {
public byte r; public byte R;
public byte g; public byte G;
public byte b; public byte B;
public byte a; public byte A;
// Example - Color.RED instead of RED // Example - Color.RED instead of RED
// Custom raylib color palette for amazing visuals // Custom raylib color palette for amazing visuals
@@ -45,23 +45,23 @@ namespace Raylib_cs
public Color(byte r, byte g, byte b, byte a) public Color(byte r, byte g, byte b, byte a)
{ {
this.r = r; this.R = r;
this.g = g; this.G = g;
this.b = b; this.B = b;
this.a = a; this.A = a;
} }
public Color(int r, int g, int b, int a) public Color(int r, int g, int b, int a)
{ {
this.r = Convert.ToByte(r); this.R = Convert.ToByte(r);
this.g = Convert.ToByte(g); this.G = Convert.ToByte(g);
this.b = Convert.ToByte(b); this.B = Convert.ToByte(b);
this.a = Convert.ToByte(a); this.A = Convert.ToByte(a);
} }
public override string ToString() public override string ToString()
{ {
return $"{{R:{r} G:{g} B:{b} A:{a}}}"; return $"{{R:{R} G:{G} B:{B} A:{A}}}";
} }
} }
} }

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs
@@ -33,27 +32,27 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Character value (Unicode) /// Character value (Unicode)
/// </summary> /// </summary>
public int value; public int Value;
/// <summary> /// <summary>
/// Character offset X when drawing /// Character offset X when drawing
/// </summary> /// </summary>
public int offsetX; public int OffsetX;
/// <summary> /// <summary>
/// Character offset Y when drawing /// Character offset Y when drawing
/// </summary> /// </summary>
public int offsetY; public int OffsetY;
/// <summary> /// <summary>
/// Character advance position X /// Character advance position X
/// </summary> /// </summary>
public int advanceX; public int AdvanceX;
/// <summary> /// <summary>
/// Character image data /// Character image data
/// </summary> /// </summary>
public Image image; public Image Image;
} }
/// <summary> /// <summary>
@@ -65,31 +64,31 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Base size (default chars height) /// Base size (default chars height)
/// </summary> /// </summary>
public int baseSize; public int BaseSize;
/// <summary> /// <summary>
/// Number of characters /// Number of characters
/// </summary> /// </summary>
public int glyphCount; public int GlyphCount;
/// <summary> /// <summary>
/// Padding around the glyph characters /// Padding around the glyph characters
/// </summary> /// </summary>
public int glyphPadding; public int GlyphPadding;
/// <summary> /// <summary>
/// Texture atlas containing the glyphs /// Texture atlas containing the glyphs
/// </summary> /// </summary>
public Texture2D texture; public Texture2D Texture;
/// <summary> /// <summary>
/// Rectangles in texture for the glyphs /// Rectangles in texture for the glyphs
/// </summary> /// </summary>
public Rectangle* recs; public Rectangle* Recs;
/// <summary> /// <summary>
/// Glyphs info data /// Glyphs info data
/// </summary> /// </summary>
public GlyphInfo* glyphs; public GlyphInfo* Glyphs;
} }
} }

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs
@@ -124,26 +123,26 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Image raw data /// Image raw data
/// </summary> /// </summary>
public void* data; public void* Data;
/// <summary> /// <summary>
/// Image base width /// Image base width
/// </summary> /// </summary>
public int width; public int Width;
/// <summary> /// <summary>
/// Image base height /// Image base height
/// </summary> /// </summary>
public int height; public int Height;
/// <summary> /// <summary>
/// Mipmap levels, 1 by default /// Mipmap levels, 1 by default
/// </summary> /// </summary>
public int mipmaps; public int Mipmaps;
/// <summary> /// <summary>
/// Data format (PixelFormat type) /// Data format (PixelFormat type)
/// </summary> /// </summary>
public PixelFormat format; public PixelFormat Format;
} }
} }

View File

@@ -398,52 +398,52 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// HMD horizontal resolution in pixels /// HMD horizontal resolution in pixels
/// </summary> /// </summary>
public int hResolution; public int HResolution;
/// <summary> /// <summary>
/// HMD vertical resolution in pixels /// HMD vertical resolution in pixels
/// </summary> /// </summary>
public int vResolution; public int VResolution;
/// <summary> /// <summary>
/// HMD horizontal size in meters /// HMD horizontal size in meters
/// </summary> /// </summary>
public float hScreenSize; public float HScreenSize;
/// <summary> /// <summary>
/// HMD vertical size in meters /// HMD vertical size in meters
/// </summary> /// </summary>
public float vScreenSize; public float VScreenSize;
/// <summary> /// <summary>
/// HMD screen center in meters /// HMD screen center in meters
/// </summary> /// </summary>
public float vScreenCenter; public float VScreenCenter;
/// <summary> /// <summary>
/// HMD distance between eye and display in meters /// HMD distance between eye and display in meters
/// </summary> /// </summary>
public float eyeToScreenDistance; public float EyeToScreenDistance;
/// <summary> /// <summary>
/// HMD lens separation distance in meters /// HMD lens separation distance in meters
/// </summary> /// </summary>
public float lensSeparationDistance; public float LensSeparationDistance;
/// <summary> /// <summary>
/// HMD IPD (distance between pupils) in meters /// HMD IPD (distance between pupils) in meters
/// </summary> /// </summary>
public float interpupillaryDistance; public float InterpupillaryDistance;
/// <summary> /// <summary>
/// HMD lens distortion constant parameters /// HMD lens distortion constant parameters
/// </summary> /// </summary>
public fixed float lensDistortionValues[4]; public fixed float LensDistortionValues[4];
/// <summary> /// <summary>
/// HMD chromatic aberration correction parameters /// HMD chromatic aberration correction parameters
/// </summary> /// </summary>
public fixed float chromaAbCorrection[4]; public fixed float ChromaAbCorrection[4];
} }
/// <summary> /// <summary>
@@ -455,51 +455,51 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// VR projection matrices (per eye) /// VR projection matrices (per eye)
/// </summary> /// </summary>
public Matrix4x4 projection1; public Matrix4x4 Projection1;
/// <summary> /// <summary>
/// VR projection matrices (per eye) /// VR projection matrices (per eye)
/// </summary> /// </summary>
public Matrix4x4 projection2; public Matrix4x4 Projection2;
/// <summary> /// <summary>
/// VR view offset matrices (per eye) /// VR view offset matrices (per eye)
/// </summary> /// </summary>
public Matrix4x4 viewOffset1; public Matrix4x4 ViewOffset1;
/// <summary> /// <summary>
/// VR view offset matrices (per eye) /// VR view offset matrices (per eye)
/// </summary> /// </summary>
public Matrix4x4 viewOffset2; public Matrix4x4 ViewOffset2;
/// <summary> /// <summary>
/// VR left lens center /// VR left lens center
/// </summary> /// </summary>
public Vector2 leftLensCenter; public Vector2 LeftLensCenter;
/// <summary> /// <summary>
/// VR right lens center /// VR right lens center
/// </summary> /// </summary>
public Vector2 rightLensCenter; public Vector2 RightLensCenter;
/// <summary> /// <summary>
/// VR left screen center /// VR left screen center
/// </summary> /// </summary>
public Vector2 leftScreenCenter; public Vector2 LeftScreenCenter;
/// <summary> /// <summary>
/// VR right screen center /// VR right screen center
/// </summary> /// </summary>
public Vector2 rightScreenCenter; public Vector2 RightScreenCenter;
/// <summary> /// <summary>
/// VR distortion scale /// VR distortion scale
/// </summary> /// </summary>
public Vector2 scale; public Vector2 Scale;
/// <summary> /// <summary>
/// VR distortion scale in /// VR distortion scale in
/// </summary> /// </summary>
public Vector2 scaleIn; public Vector2 ScaleIn;
} }
} }

View File

@@ -13,28 +13,28 @@ namespace Raylib_cs
internal const string LibSystem = "libSystem"; internal const string LibSystem = "libSystem";
[DllImport(LibSystem, EntryPoint = "vasprintf", CallingConvention = CallingConvention.Cdecl)] [DllImport(LibSystem, EntryPoint = "vasprintf", CallingConvention = CallingConvention.Cdecl)]
public static extern int vasprintf_apple(ref IntPtr buffer, IntPtr format, IntPtr args); public static extern int VasPrintfApple(ref IntPtr buffer, IntPtr format, IntPtr args);
[DllImport(Libc, EntryPoint = "vsprintf", CallingConvention = CallingConvention.Cdecl)] [DllImport(Libc, EntryPoint = "vsprintf", CallingConvention = CallingConvention.Cdecl)]
public static extern int vsprintf_linux(IntPtr buffer, IntPtr format, IntPtr args); public static extern int VsPrintfLinux(IntPtr buffer, IntPtr format, IntPtr args);
[DllImport(Msvcrt, EntryPoint = "vsprintf", CallingConvention = CallingConvention.Cdecl)] [DllImport(Msvcrt, EntryPoint = "vsprintf", CallingConvention = CallingConvention.Cdecl)]
public static extern int vsprintf_windows(IntPtr buffer, IntPtr format, IntPtr args); public static extern int VsPrintfWindows(IntPtr buffer, IntPtr format, IntPtr args);
[DllImport(Libc, EntryPoint = "vsnprintf", CallingConvention = CallingConvention.Cdecl)] [DllImport(Libc, EntryPoint = "vsnprintf", CallingConvention = CallingConvention.Cdecl)]
public static extern int vsnprintf_linux(IntPtr buffer, UIntPtr size, IntPtr format, IntPtr args); public static extern int VsnPrintfLinux(IntPtr buffer, UIntPtr size, IntPtr format, IntPtr args);
[DllImport(Msvcrt, EntryPoint = "vsnprintf", CallingConvention = CallingConvention.Cdecl)] [DllImport(Msvcrt, EntryPoint = "vsnprintf", CallingConvention = CallingConvention.Cdecl)]
public static extern int vsnprintf_windows(IntPtr buffer, UIntPtr size, IntPtr format, IntPtr args); public static extern int VsnPrintfWindows(IntPtr buffer, UIntPtr size, IntPtr format, IntPtr args);
} }
[StructLayout(LayoutKind.Sequential, Pack = 4)] [StructLayout(LayoutKind.Sequential, Pack = 4)]
struct VaListLinuxX64 struct VaListLinuxX64
{ {
uint gpOffset; uint _gpOffset;
uint fpOffset; uint _fpOffset;
IntPtr overflowArgArea; IntPtr _overflowArgArea;
IntPtr regSaveArea; IntPtr _regSaveArea;
} }
/// <summary> /// <summary>
@@ -62,14 +62,14 @@ namespace Raylib_cs
return LinuxX64LogCallback(format, args); return LinuxX64LogCallback(format, args);
} }
var byteLength = vsnprintf(IntPtr.Zero, UIntPtr.Zero, format, args) + 1; var byteLength = VsnPrintf(IntPtr.Zero, UIntPtr.Zero, format, args) + 1;
if (byteLength <= 1) if (byteLength <= 1)
{ {
return string.Empty; return string.Empty;
} }
var buffer = Marshal.AllocHGlobal(byteLength); var buffer = Marshal.AllocHGlobal(byteLength);
vsprintf(buffer, format, args); VsPrintf(buffer, format, args);
string result = Marshal.PtrToStringUTF8(buffer); string result = Marshal.PtrToStringUTF8(buffer);
Marshal.FreeHGlobal(buffer); Marshal.FreeHGlobal(buffer);
@@ -82,7 +82,7 @@ namespace Raylib_cs
IntPtr buffer = IntPtr.Zero; IntPtr buffer = IntPtr.Zero;
try try
{ {
var count = Native.vasprintf_apple(ref buffer, format, args); var count = Native.VasPrintfApple(ref buffer, format, args);
if (count == -1) if (count == -1)
{ {
return string.Empty; return string.Empty;
@@ -106,7 +106,7 @@ namespace Raylib_cs
// Get length of args // Get length of args
listPointer = Marshal.AllocHGlobal(Marshal.SizeOf(listStructure)); listPointer = Marshal.AllocHGlobal(Marshal.SizeOf(listStructure));
Marshal.StructureToPtr(listStructure, listPointer, false); Marshal.StructureToPtr(listStructure, listPointer, false);
byteLength = Native.vsnprintf_linux(IntPtr.Zero, UIntPtr.Zero, format, listPointer) + 1; byteLength = Native.VsnPrintfLinux(IntPtr.Zero, UIntPtr.Zero, format, listPointer) + 1;
// Allocate buffer for result // Allocate buffer for result
Marshal.StructureToPtr(listStructure, listPointer, false); Marshal.StructureToPtr(listStructure, listPointer, false);
@@ -115,7 +115,7 @@ namespace Raylib_cs
utf8Buffer = Marshal.AllocHGlobal(byteLength); utf8Buffer = Marshal.AllocHGlobal(byteLength);
// Print result into buffer // Print result into buffer
Native.vsprintf_linux(utf8Buffer, format, listPointer); Native.VsPrintfLinux(utf8Buffer, format, listPointer);
result = Marshal.PtrToStringUTF8(utf8Buffer); result = Marshal.PtrToStringUTF8(utf8Buffer);
Marshal.FreeHGlobal(listPointer); Marshal.FreeHGlobal(listPointer);
@@ -125,38 +125,38 @@ namespace Raylib_cs
} }
// https://github.com/dotnet/runtime/issues/51052 // https://github.com/dotnet/runtime/issues/51052
static int vsnprintf(IntPtr buffer, UIntPtr size, IntPtr format, IntPtr args) static int VsnPrintf(IntPtr buffer, UIntPtr size, IntPtr format, IntPtr args)
{ {
var os = Environment.OSVersion; var os = Environment.OSVersion;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{ {
return Native.vsnprintf_windows(buffer, size, format, args); return Native.VsnPrintfWindows(buffer, size, format, args);
} }
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{ {
return Native.vsnprintf_linux(buffer, size, format, args); return Native.VsnPrintfLinux(buffer, size, format, args);
} }
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID"))) else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")))
{ {
return Native.vsprintf_linux(buffer, format, args); return Native.VsPrintfLinux(buffer, format, args);
} }
return -1; return -1;
} }
// yhttps://github.com/dotnet/runtime/issues/51052 // https://github.com/dotnet/runtime/issues/51052
static int vsprintf(IntPtr buffer, IntPtr format, IntPtr args) static int VsPrintf(IntPtr buffer, IntPtr format, IntPtr args)
{ {
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{ {
return Native.vsprintf_windows(buffer, format, args); return Native.VsPrintfWindows(buffer, format, args);
} }
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{ {
return Native.vsprintf_linux(buffer, format, args); return Native.VsPrintfLinux(buffer, format, args);
} }
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID"))) else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")))
{ {
return Native.vsprintf_linux(buffer, format, args); return Native.VsPrintfLinux(buffer, format, args);
} }
return -1; return -1;
} }

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs
@@ -54,17 +53,17 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Material map texture /// Material map texture
/// </summary> /// </summary>
public Texture2D texture; public Texture2D Texture;
/// <summary> /// <summary>
/// Material map color /// Material map color
/// </summary> /// </summary>
public Color color; public Color Color;
/// <summary> /// <summary>
/// Material map value /// Material map value
/// </summary> /// </summary>
public float value; public float Value;
} }
/// <summary> /// <summary>
@@ -76,17 +75,17 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Material shader /// Material shader
/// </summary> /// </summary>
public Shader shader; public Shader Shader;
//TODO: convert //TODO: convert
/// <summary> /// <summary>
/// Material maps /// Material maps
/// </summary> /// </summary>
public MaterialMap* maps; public MaterialMap* Maps;
/// <summary> /// <summary>
/// Material generic parameters (if required) /// Material generic parameters (if required)
/// </summary> /// </summary>
public fixed float param[4]; public fixed float Param[4];
} }
} }

View File

@@ -1,5 +1,3 @@
using System;
using System.Numerics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs
@@ -14,49 +12,49 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Number of vertices stored in arrays /// Number of vertices stored in arrays
/// </summary> /// </summary>
public int vertexCount; public int VertexCount;
/// <summary> /// <summary>
/// Number of triangles stored (indexed or not) /// Number of triangles stored (indexed or not)
/// </summary> /// </summary>
public int triangleCount; public int TriangleCount;
#region Default vertex data #region Default vertex data
/// <summary> /// <summary>
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0) /// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
/// </summary> /// </summary>
public float* vertices; public float* Vertices;
/// <summary> /// <summary>
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
/// </summary> /// </summary>
public float* texcoords; public float* TexCoords;
/// <summary> /// <summary>
/// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) /// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
/// </summary> /// </summary>
public float* texcoords2; public float* TexCoords2;
/// <summary> /// <summary>
/// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) /// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
/// </summary> /// </summary>
public float* normals; public float* Normals;
/// <summary> /// <summary>
/// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) /// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
/// </summary> /// </summary>
public float* tangents; public float* Tangents;
/// <summary> /// <summary>
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
/// </summary> /// </summary>
public byte* colors; public byte* Colors;
/// <summary> /// <summary>
/// Vertex indices (in case vertex data comes indexed) /// Vertex indices (in case vertex data comes indexed)
/// </summary> /// </summary>
public ushort* indices; public ushort* Indices;
#endregion #endregion
@@ -65,22 +63,22 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Animated vertex positions (after bones transformations) /// Animated vertex positions (after bones transformations)
/// </summary> /// </summary>
public float* animVertices; public float* AnimVertices;
/// <summary> /// <summary>
/// Animated normals (after bones transformations) /// Animated normals (after bones transformations)
/// </summary> /// </summary>
public float* animNormals; public float* AnimNormals;
/// <summary> /// <summary>
/// Vertex bone ids, up to 4 bones influence by vertex (skinning) /// Vertex bone ids, up to 4 bones influence by vertex (skinning)
/// </summary> /// </summary>
public byte* boneIds; public byte* BoneIds;
/// <summary> /// <summary>
/// Vertex bone weight, up to 4 bones influence by vertex (skinning) /// Vertex bone weight, up to 4 bones influence by vertex (skinning)
/// </summary> /// </summary>
public float* boneWeights; public float* BoneWeights;
#endregion #endregion
@@ -89,12 +87,12 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// OpenGL Vertex Array Object id /// OpenGL Vertex Array Object id
/// </summary> /// </summary>
public uint vaoId; public uint VaoId;
/// <summary> /// <summary>
/// OpenGL Vertex Buffer Objects id (default vertex data, uint[]) /// OpenGL Vertex Buffer Objects id (default vertex data, uint[])
/// </summary> /// </summary>
public uint* vboId; public uint* VboId;
#endregion #endregion
} }

View File

@@ -13,12 +13,12 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Bone name (char[32]) /// Bone name (char[32])
/// </summary> /// </summary>
public fixed sbyte name[32]; public fixed sbyte Name[32];
/// <summary> /// <summary>
/// Bone parent /// Bone parent
/// </summary> /// </summary>
public int parent; public int Parent;
} }
/// <summary> /// <summary>
@@ -30,49 +30,49 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Local transform matrix /// Local transform matrix
/// </summary> /// </summary>
public Matrix4x4 transform; public Matrix4x4 Transform;
/// <summary> /// <summary>
/// Number of meshes /// Number of meshes
/// </summary> /// </summary>
public int meshCount; public int MeshCount;
/// <summary> /// <summary>
/// Number of materials /// Number of materials
/// </summary> /// </summary>
public int materialCount; public int MaterialCount;
/// <summary> /// <summary>
/// Meshes array (Mesh *) /// Meshes array (Mesh *)
/// </summary> /// </summary>
public Mesh* meshes; public Mesh* Meshes;
/// <summary> /// <summary>
/// Materials array (Material *) /// Materials array (Material *)
/// </summary> /// </summary>
public Material* materials; public Material* Materials;
/// <summary> /// <summary>
/// Mesh material number (int *) /// Mesh material number (int *)
/// </summary> /// </summary>
public int* meshMaterial; public int* MeshMaterial;
/// <summary> /// <summary>
/// Number of bones /// Number of bones
/// </summary> /// </summary>
public int boneCount; public int BoneCount;
//TODO: Span //TODO: Span
/// <summary> /// <summary>
/// Bones information (skeleton, BoneInfo *) /// Bones information (skeleton, BoneInfo *)
/// </summary> /// </summary>
public BoneInfo* bones; public BoneInfo* Bones;
//TODO: Span //TODO: Span
/// <summary> /// <summary>
/// Bones base transformation (pose, Transform *) /// Bones base transformation (pose, Transform *)
/// </summary> /// </summary>
public Transform* bindPose; public Transform* BindPose;
} }
/// <summary> /// <summary>
@@ -84,68 +84,62 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Number of bones /// Number of bones
/// </summary> /// </summary>
public readonly int boneCount; public readonly int BoneCount;
/// <summary> /// <summary>
/// Number of animation frames /// Number of animation frames
/// </summary> /// </summary>
public readonly int frameCount; public readonly int FrameCount;
/// <summary> /// <summary>
/// Bones information (skeleton, BoneInfo *) /// Bones information (skeleton, BoneInfo *)
/// </summary> /// </summary>
public readonly BoneInfo* bones; public readonly BoneInfo* Bones;
/// <inheritdoc cref="bones"/> /// <inheritdoc cref="Bones"/>
public ReadOnlySpan<BoneInfo> BoneInfo => new(bones, boneCount); public ReadOnlySpan<BoneInfo> BoneInfo => new(Bones, BoneCount);
/// <summary> /// <summary>
/// Poses array by frame (Transform **) /// Poses array by frame (Transform **)
/// </summary> /// </summary>
public readonly Transform** framePoses; public readonly Transform** FramePoses;
/// <inheritdoc cref="framePoses"/> /// <inheritdoc cref="FramePoses"/>
public FramePosesCollection FramePoses => new(framePoses, frameCount, boneCount); public FramePosesCollection FramePosesColl => new(FramePoses, FrameCount, BoneCount);
public struct FramePosesCollection public struct FramePosesCollection
{ {
readonly Transform** framePoses; readonly Transform** _framePoses;
readonly int frameCount; readonly int _frameCount;
readonly int boneCount; readonly int _boneCount;
public FramePoses this[int index] => new(framePoses[index], boneCount); public FramePoses this[int index] => new(_framePoses[index], _boneCount);
public Transform this[int index1, int index2] => new FramePoses(framePoses[index1], boneCount)[index2]; public Transform this[int index1, int index2] => new FramePoses(_framePoses[index1], _boneCount)[index2];
internal FramePosesCollection(Transform** framePoses, int frameCount, int boneCount) internal FramePosesCollection(Transform** framePoses, int frameCount, int boneCount)
{ {
this.framePoses = framePoses; this._framePoses = framePoses;
this.frameCount = frameCount; this._frameCount = frameCount;
this.boneCount = boneCount; this._boneCount = boneCount;
} }
} }
} }
public unsafe struct FramePoses public unsafe struct FramePoses
{ {
readonly Transform* poses; readonly Transform* _poses;
readonly int count; readonly int _count;
public ref Transform this[int index] public ref Transform this[int index] => ref _poses[index];
{
get
{
return ref poses[index];
}
}
internal FramePoses(Transform* poses, int count) internal FramePoses(Transform* poses, int count)
{ {
this.poses = poses; this._poses = poses;
this.count = count; this._count = count;
} }
} }
} }

View File

@@ -32,31 +32,31 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Texture source rectangle /// Texture source rectangle
/// </summary> /// </summary>
public Rectangle source; public Rectangle Source;
/// <summary> /// <summary>
/// Left border offset /// Left border offset
/// </summary> /// </summary>
public int left; public int Left;
/// <summary> /// <summary>
/// Top border offset /// Top border offset
/// </summary> /// </summary>
public int top; public int Top;
/// <summary> /// <summary>
/// Right border offset /// Right border offset
/// </summary> /// </summary>
public int right; public int Right;
/// <summary> /// <summary>
/// Bottom border offset /// Bottom border offset
/// </summary> /// </summary>
public int bottom; public int Bottom;
/// <summary> /// <summary>
/// Layout of the n-patch: 3x3, 1x3 or 3x1 /// Layout of the n-patch: 3x3, 1x3 or 3x1
/// </summary> /// </summary>
public NPatchLayout layout; public NPatchLayout Layout;
} }
} }

View File

@@ -12,17 +12,17 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Ray position (origin) /// Ray position (origin)
/// </summary> /// </summary>
public Vector3 position; public Vector3 Position;
/// <summary> /// <summary>
/// Ray direction /// Ray direction
/// </summary> /// </summary>
public Vector3 direction; public Vector3 Direction;
public Ray(Vector3 position, Vector3 direction) public Ray(Vector3 position, Vector3 direction)
{ {
this.position = position; this.Position = position;
this.direction = direction; this.Direction = direction;
} }
} }
@@ -35,21 +35,21 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Did the ray hit something? /// Did the ray hit something?
/// </summary> /// </summary>
public CBool hit; public CBool Hit;
/// <summary> /// <summary>
/// Distance to the nearest hit /// Distance to the nearest hit
/// </summary> /// </summary>
public float distance; public float Distance;
/// <summary> /// <summary>
/// Point of the nearest hit /// Point of the nearest hit
/// </summary> /// </summary>
public Vector3 point; public Vector3 Point;
/// <summary> /// <summary>
/// Surface normal of hit /// Surface normal of hit
/// </summary> /// </summary>
public Vector3 normal; public Vector3 Normal;
} }
} }

View File

@@ -222,11 +222,11 @@ namespace Raylib_cs
public static string[] GetDroppedFiles() public static string[] GetDroppedFiles()
{ {
var filePathList = LoadDroppedFiles(); var filePathList = LoadDroppedFiles();
var files = new string[filePathList.count]; var files = new string[filePathList.Count];
for (var i = 0; i < filePathList.count; i++) for (var i = 0; i < filePathList.Count; i++)
{ {
files[i] = Marshal.PtrToStringUTF8((IntPtr)filePathList.paths[i]); files[i] = Marshal.PtrToStringUTF8((IntPtr)filePathList.Paths[i]);
} }
UnloadDroppedFiles(filePathList); UnloadDroppedFiles(filePathList);
@@ -1036,12 +1036,12 @@ namespace Raylib_cs
public static Material GetMaterial(ref Model model, int materialIndex) public static Material GetMaterial(ref Model model, int materialIndex)
{ {
return model.materials[materialIndex]; return model.Materials[materialIndex];
} }
public static Texture2D GetMaterialTexture(ref Model model, int materialIndex, MaterialMapIndex mapIndex) public static Texture2D GetMaterialTexture(ref Model model, int materialIndex, MaterialMapIndex mapIndex)
{ {
return model.materials[materialIndex].maps[(int)mapIndex].texture; return model.Materials[materialIndex].Maps[(int)mapIndex].Texture;
} }
public static void SetMaterialTexture( public static void SetMaterialTexture(
@@ -1051,12 +1051,12 @@ namespace Raylib_cs
ref Texture2D texture ref Texture2D texture
) )
{ {
SetMaterialTexture(&model.materials[materialIndex], mapIndex, texture); SetMaterialTexture(&model.Materials[materialIndex], mapIndex, texture);
} }
public static void SetMaterialShader(ref Model model, int materialIndex, ref Shader shader) public static void SetMaterialShader(ref Model model, int materialIndex, ref Shader shader)
{ {
model.materials[materialIndex].shader = shader; model.Materials[materialIndex].Shader = shader;
} }
} }
} }

View File

@@ -8,22 +8,21 @@ namespace Raylib_cs
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public partial struct Rectangle public partial struct Rectangle
{ {
public float x; public float X;
public float y; public float Y;
public float width; public float Width;
public float height; public float Height;
public Rectangle(float x, float y, float width, float height) public Rectangle(float x, float y, float width, float height) {
{ this.X = x;
this.x = x; this.Y = y;
this.y = y; this.Width = width;
this.width = width; this.Height = height;
this.height = height;
} }
public override string ToString() public override string ToString()
{ {
return $"{{X:{x} Y:{y} Width:{width} Height:{height}}}"; return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}";
} }
} }
} }

View File

@@ -11,32 +11,32 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Number of vertex buffers (multi-buffering support) /// Number of vertex buffers (multi-buffering support)
/// </summary> /// </summary>
int buffersCount; int _buffersCount;
/// <summary> /// <summary>
/// Current buffer tracking in case of multi-buffering /// Current buffer tracking in case of multi-buffering
/// </summary> /// </summary>
int currentBuffer; int _currentBuffer;
/// <summary> /// <summary>
/// Dynamic buffer(s) for vertex data /// Dynamic buffer(s) for vertex data
/// </summary> /// </summary>
VertexBuffer* vertexBuffer; VertexBuffer* _vertexBuffer;
/// <summary> /// <summary>
/// Draw calls array, depends on textureId /// Draw calls array, depends on textureId
/// </summary> /// </summary>
DrawCall* draws; DrawCall* _draws;
/// <summary> /// <summary>
/// Draw calls counter /// Draw calls counter
/// </summary> /// </summary>
int drawsCounter; int _drawsCounter;
/// <summary> /// <summary>
/// Current depth value for next draw /// Current depth value for next draw
/// </summary> /// </summary>
float currentDepth; float _currentDepth;
} }
/// <summary> /// <summary>
@@ -48,39 +48,39 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Number of elements in the buffer (QUADS) /// Number of elements in the buffer (QUADS)
/// </summary> /// </summary>
public int elementCount; public int ElementCount;
/// <summary> /// <summary>
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0) /// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
/// </summary> /// </summary>
public float* vertices; public float* Vertices;
/// <summary> /// <summary>
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
/// </summary> /// </summary>
public float* texcoords; public float* TexCoords;
/// <summary> /// <summary>
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
/// </summary> /// </summary>
public byte* colors; public byte* Colors;
/// <summary> /// <summary>
/// Vertex indices (in case vertex data comes indexed) (6 indices per quad)<br/> /// Vertex indices (in case vertex data comes indexed) (6 indices per quad)<br/>
/// unsigned int* for GRAPHICS_API_OPENGL_11 or GRAPHICS_API_OPENGL_33<br/> /// unsigned int* for GRAPHICS_API_OPENGL_11 or GRAPHICS_API_OPENGL_33<br/>
/// unsigned short* for GRAPHICS_API_OPENGL_ES2 /// unsigned short* for GRAPHICS_API_OPENGL_ES2
/// </summary> /// </summary>
public void* indices; public void* Indices;
/// <summary> /// <summary>
/// OpenGL Vertex Array Object id /// OpenGL Vertex Array Object id
/// </summary> /// </summary>
public uint vaoId; public uint VaoId;
/// <summary> /// <summary>
/// OpenGL Vertex Buffer Objects id (4 types of vertex data) /// OpenGL Vertex Buffer Objects id (4 types of vertex data)
/// </summary> /// </summary>
public fixed uint vboId[4]; public fixed uint VboId[4];
} }
/// <summary> /// <summary>
@@ -92,22 +92,22 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Drawing mode: LINES, TRIANGLES, QUADS /// Drawing mode: LINES, TRIANGLES, QUADS
/// </summary> /// </summary>
int mode; int _mode;
/// <summary> /// <summary>
/// Number of vertices for the draw call /// Number of vertices for the draw call
/// </summary> /// </summary>
int vertexCount; int _vertexCount;
/// <summary> /// <summary>
/// Number of vertices required for index alignment (LINES, TRIANGLES) /// Number of vertices required for index alignment (LINES, TRIANGLES)
/// </summary> /// </summary>
int vertexAlignment; int _vertexAlignment;
/// <summary> /// <summary>
/// Texture id to be used on the draw -> Use to create new draw call if changes /// Texture id to be used on the draw -> Use to create new draw call if changes
/// </summary> /// </summary>
uint textureId; uint _textureId;
} }
public enum GlVersion public enum GlVersion

View File

@@ -11,16 +11,16 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// OpenGL Framebuffer Object (FBO) id /// OpenGL Framebuffer Object (FBO) id
/// </summary> /// </summary>
public uint id; public uint Id;
/// <summary> /// <summary>
/// Color buffer attachment texture /// Color buffer attachment texture
/// </summary> /// </summary>
public Texture2D texture; public Texture2D Texture;
/// <summary> /// <summary>
/// Depth buffer attachment texture /// Depth buffer attachment texture
/// </summary> /// </summary>
public Texture2D depth; public Texture2D Depth;
} }
} }

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs
@@ -75,11 +74,11 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Shader program id /// Shader program id
/// </summary> /// </summary>
public uint id; public uint Id;
/// <summary> /// <summary>
/// Shader locations array (MAX_SHADER_LOCATIONS, int *) /// Shader locations array (MAX_SHADER_LOCATIONS, int *)
/// </summary> /// </summary>
public int* locs; public int* Locs;
} }
} }

View File

@@ -112,26 +112,26 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// OpenGL texture id /// OpenGL texture id
/// </summary> /// </summary>
public uint id; public uint Id;
/// <summary> /// <summary>
/// Texture base width /// Texture base width
/// </summary> /// </summary>
public int width; public int Width;
/// <summary> /// <summary>
/// Texture base height /// Texture base height
/// </summary> /// </summary>
public int height; public int Height;
/// <summary> /// <summary>
/// Mipmap levels, 1 by default /// Mipmap levels, 1 by default
/// </summary> /// </summary>
public int mipmaps; public int Mipmaps;
/// <summary> /// <summary>
/// Data format (PixelFormat type) /// Data format (PixelFormat type)
/// </summary> /// </summary>
public PixelFormat format; public PixelFormat Format;
} }
} }

View File

@@ -12,16 +12,16 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Translation /// Translation
/// </summary> /// </summary>
public Vector3 translation; public Vector3 Translation;
/// <summary> /// <summary>
/// Rotation /// Rotation
/// </summary> /// </summary>
public Quaternion rotation; public Quaternion Rotation;
/// <summary> /// <summary>
/// Scale /// Scale
/// </summary> /// </summary>
public Vector3 scale; public Vector3 Scale;
} }
} }

View File

@@ -20,42 +20,42 @@ namespace Raylib_cs
* *
* 'value' is visible and constructable (if necessary), but impossible to modify or access. * 'value' is visible and constructable (if necessary), but impossible to modify or access.
*/ */
public sbyte value { init; private get; } public sbyte Value { init; private get; }
// Constructors for easier usage. // Constructors for easier usage.
public CBool(bool value) public CBool(bool value)
{ {
this.value = (sbyte)(value ? 1 : 0); this.Value = (sbyte)(value ? 1 : 0);
} }
public CBool(Int64 value) public CBool(Int64 value)
{ {
this.value = (sbyte)(value != 0 ? 1 : 0); this.Value = (sbyte)(value != 0 ? 1 : 0);
} }
// CBool -> Native // CBool -> Native
// Allows for arithmetic between CBools and for assignment to greater integer variables. // Allows for arithmetic between CBools and for assignment to greater integer variables.
public static implicit operator sbyte(CBool x) public static implicit operator sbyte(CBool x)
{ {
return x.value; return x.Value;
} }
// Allows for CBools to be implicitely assigned to a native boolean variable. // Allows for CBools to be implicitely assigned to a native boolean variable.
public static implicit operator bool(CBool x) public static implicit operator bool(CBool x)
{ {
return x.value != 0 ? true : false; return x.Value != 0 ? true : false;
} }
// Native -> CBool // Native -> CBool
// Allows native booleans to be implicitely constructed into CBools while passing parameters. // Allows native booleans to be implicitely constructed into CBools while passing parameters.
public static implicit operator CBool(bool x) public static implicit operator CBool(bool x)
{ {
return new CBool { value = (sbyte)(x ? 1 : 0) }; return new CBool { Value = (sbyte)(x ? 1 : 0) };
} }
// Same goes for integer numeric values (any value, so an Int64 is used). // Same goes for integer numeric values (any value, so an Int64 is used).
public static implicit operator CBool(Int64 x) public static implicit operator CBool(Int64 x)
{ {
return new CBool { value = (sbyte)(x != 0 ? 1 : 0) }; return new CBool { Value = (sbyte)(x != 0 ? 1 : 0) };
} }
/* Arithmetic overloads /* Arithmetic overloads
@@ -69,13 +69,13 @@ namespace Raylib_cs
// Addition // Addition
public static CBool operator +(CBool left, CBool right) public static CBool operator +(CBool left, CBool right)
{ {
return new CBool { value = (sbyte)(left.value + right.value) }; return new CBool { Value = (sbyte)(left.Value + right.Value) };
} }
// Subtraction // Subtraction
public static CBool operator -(CBool left, CBool right) public static CBool operator -(CBool left, CBool right)
{ {
return new CBool { value = (sbyte)(left.value - right.value) }; return new CBool { Value = (sbyte)(left.Value - right.Value) };
} }
// ToString override // ToString override

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs
@@ -12,16 +11,16 @@ namespace Raylib_cs
/// <summary> /// <summary>
/// Filepaths max entries /// Filepaths max entries
/// </summary> /// </summary>
public uint capacity; public uint Capacity;
/// <summary> /// <summary>
/// Filepaths entries count /// Filepaths entries count
/// </summary> /// </summary>
public uint count; public uint Count;
/// <summary> /// <summary>
/// Filepaths entries /// Filepaths entries
/// </summary> /// </summary>
public byte** paths; public byte** Paths;
} }
} }

View File

@@ -9,21 +9,21 @@ namespace Raylib_cs
/// </summary> /// </summary>
public ref struct UTF8Buffer public ref struct UTF8Buffer
{ {
private IntPtr data; private IntPtr _data;
public UTF8Buffer(string text) public UTF8Buffer(string text)
{ {
data = Marshal.StringToCoTaskMemUTF8(text); _data = Marshal.StringToCoTaskMemUTF8(text);
} }
public unsafe sbyte* AsPointer() public unsafe sbyte* AsPointer()
{ {
return (sbyte*)data.ToPointer(); return (sbyte*)_data.ToPointer();
} }
public void Dispose() public void Dispose()
{ {
Marshal.FreeCoTaskMem(data); Marshal.FreeCoTaskMem(_data);
} }
} }