From d9202ba262099a0eecbab9f93fa05a847134a713 Mon Sep 17 00:00:00 2001 From: MrScautHD <65916181+MrScautHD@users.noreply.github.com> Date: Sat, 5 Aug 2023 20:21:41 +0200 Subject: [PATCH] Fixed names in Rlgl (#182) --- Raylib-cs.Tests/BlittableHelper.cs | 4 +- Raylib-cs/interop/Rlgl.cs | 715 ++++++++++++++--------------- 2 files changed, 359 insertions(+), 360 deletions(-) diff --git a/Raylib-cs.Tests/BlittableHelper.cs b/Raylib-cs.Tests/BlittableHelper.cs index 7df12d0..4b9e497 100644 --- a/Raylib-cs.Tests/BlittableHelper.cs +++ b/Raylib-cs.Tests/BlittableHelper.cs @@ -36,7 +36,7 @@ namespace Raylib_cs.Tests { public static bool IsBlittable() { - return IsBlittableCache.Value; + return IsBlittableCache.VALUE; } public static bool IsBlittable(this Type type) @@ -64,7 +64,7 @@ namespace Raylib_cs.Tests private static class IsBlittableCache { - public static readonly bool Value = IsBlittable(typeof(T)); + public static readonly bool VALUE = IsBlittable(typeof(T)); } } } diff --git a/Raylib-cs/interop/Rlgl.cs b/Raylib-cs/interop/Rlgl.cs index 9e09982..3c2a405 100644 --- a/Raylib-cs/interop/Rlgl.cs +++ b/Raylib-cs/interop/Rlgl.cs @@ -17,130 +17,130 @@ namespace Raylib_cs public const int DEFAULT_BATCH_DRAWCALLS = 256; public const int MAX_BATCH_ACTIVE_TEXTURES = 4; public const int MAX_MATRIX_STACK_SIZE = 32; - public const float RL_CULL_DISTANCE_NEAR = 0.01f; - public const float RL_CULL_DISTANCE_FAR = 1000.0f; + public const float CULL_DISTANCE_NEAR = 0.01f; + public const float CULL_DISTANCE_FAR = 1000.0f; // Texture parameters (equivalent to OpenGL defines) - public const int RL_TEXTURE_WRAP_S = 0x2802; - public const int RL_TEXTURE_WRAP_T = 0x2803; - public const int RL_TEXTURE_MAG_FILTER = 0x2800; - public const int RL_TEXTURE_MIN_FILTER = 0x2801; + public const int TEXTURE_WRAP_S = 0x2802; + public const int TEXTURE_WRAP_T = 0x2803; + public const int TEXTURE_MAG_FILTER = 0x2800; + public const int TEXTURE_MIN_FILTER = 0x2801; - public const int RL_TEXTURE_FILTER_NEAREST = 0x2600; - public const int RL_TEXTURE_FILTER_LINEAR = 0x2601; - public const int RL_TEXTURE_FILTER_MIP_NEAREST = 0x2700; - public const int RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 0x2702; - public const int RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 0x2701; - public const int RL_TEXTURE_FILTER_MIP_LINEAR = 0x2703; - public const int RL_TEXTURE_FILTER_ANISOTROPIC = 0x3000; - public const int RL_TEXTURE_MIPMAP_BIAS_RATIO = 0x4000; + public const int TEXTURE_FILTER_NEAREST = 0x2600; + public const int TEXTURE_FILTER_LINEAR = 0x2601; + public const int TEXTURE_FILTER_MIP_NEAREST = 0x2700; + public const int TEXTURE_FILTER_NEAREST_MIP_LINEAR = 0x2702; + public const int TEXTURE_FILTER_LINEAR_MIP_NEAREST = 0x2701; + public const int TEXTURE_FILTER_MIP_LINEAR = 0x2703; + public const int TEXTURE_FILTER_ANISOTROPIC = 0x3000; + public const int TEXTURE_MIPMAP_BIAS_RATIO = 0x4000; - public const int RL_TEXTURE_WRAP_REPEAT = 0x2901; - public const int RL_TEXTURE_WRAP_CLAMP = 0x812F; - public const int RL_TEXTURE_WRAP_MIRROR_REPEAT = 0x8370; - public const int RL_TEXTURE_WRAP_MIRROR_CLAMP = 0x8742; + public const int TEXTURE_WRAP_REPEAT = 0x2901; + public const int TEXTURE_WRAP_CLAMP = 0x812F; + public const int TEXTURE_WRAP_MIRROR_REPEAT = 0x8370; + public const int TEXTURE_WRAP_MIRROR_CLAMP = 0x8742; // GL equivalent data types - public const int RL_UNSIGNED_BYTE = 0x1401; - public const int RL_FLOAT = 0x1406; + public const int UNSIGNED_BYTE = 0x1401; + public const int FLOAT = 0x1406; // Buffer usage hint - public const int RL_STREAM_DRAW = 0x88E0; - public const int RL_STREAM_READ = 0x88E1; - public const int RL_STREAM_COPY = 0x88E2; - public const int RL_STATIC_DRAW = 0x88E4; - public const int RL_STATIC_READ = 0x88E5; - public const int RL_STATIC_COPY = 0x88E6; - public const int RL_DYNAMIC_DRAW = 0x88E8; - public const int RL_DYNAMIC_READ = 0x88E9; - public const int RL_DYNAMIC_COPY = 0x88EA; + public const int STREAM_DRAW = 0x88E0; + public const int STREAM_READ = 0x88E1; + public const int STREAM_COPY = 0x88E2; + public const int STATIC_DRAW = 0x88E4; + public const int STATIC_READ = 0x88E5; + public const int STATIC_COPY = 0x88E6; + public const int DYNAMIC_DRAW = 0x88E8; + public const int DYNAMIC_READ = 0x88E9; + public const int DYNAMIC_COPY = 0x88EA; // GL blending factors - public const int RL_ZERO = 0; - public const int RL_ONE = 1; - public const int RL_SRC_COLOR = 0x0300; - public const int RL_ONE_MINUS_SRC_COLOR = 0x0301; - public const int RL_SRC_ALPHA = 0x0302; - public const int RL_ONE_MINUS_SRC_ALPHA = 0x0303; - public const int RL_DST_ALPHA = 0x0304; - public const int RL_ONE_MINUS_DST_ALPHA = 0x0305; - public const int RL_DST_COLOR = 0x0306; - public const int RL_ONE_MINUS_DST_COLOR = 0x0307; - public const int RL_SRC_ALPHA_SATURATE = 0x0308; - public const int RL_CONSTANT_COLOR = 0x8001; - public const int RL_ONE_MINUS_CONSTANT_COLOR = 0x8002; - public const int RL_CONSTANT_ALPHA = 0x8003; - public const int RL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; + public const int ZERO = 0; + public const int ONE = 1; + public const int SRC_COLOR = 0x0300; + public const int ONE_MINUS_SRC_COLOR = 0x0301; + public const int SRC_ALPHA = 0x0302; + public const int ONE_MINUS_SRC_ALPHA = 0x0303; + public const int DST_ALPHA = 0x0304; + public const int ONE_MINUS_DST_ALPHA = 0x0305; + public const int DST_COLOR = 0x0306; + public const int ONE_MINUS_DST_COLOR = 0x0307; + public const int SRC_ALPHA_SATURATE = 0x0308; + public const int CONSTANT_COLOR = 0x8001; + public const int ONE_MINUS_CONSTANT_COLOR = 0x8002; + public const int CONSTANT_ALPHA = 0x8003; + public const int ONE_MINUS_CONSTANT_ALPHA = 0x8004; // GL blending functions/equations - public const int RL_FUNC_ADD = 0x8006; - public const int RL_MIN = 0x8007; - public const int RL_MAX = 0x8008; - public const int RL_FUNC_SUBTRACT = 0x800A; - public const int RL_FUNC_REVERSE_SUBTRACT = 0x800B; - public const int RL_BLEND_EQUATION = 0x8009; - public const int RL_BLEND_EQUATION_RGB = 0x8009; - public const int RL_BLEND_EQUATION_ALPHA = 0x883D; - public const int RL_BLEND_DST_RGB = 0x80C8; - public const int RL_BLEND_SRC_RGB = 0x80C9; - public const int RL_BLEND_DST_ALPHA = 0x80CA; - public const int RL_BLEND_SRC_ALPHA = 0x80CB; - public const int RL_BLEND_COLOR = 0x8005; + public const int FUNC_ADD = 0x8006; + public const int MIN = 0x8007; + public const int MAX = 0x8008; + public const int FUNC_SUBTRACT = 0x800A; + public const int FUNC_REVERSE_SUBTRACT = 0x800B; + public const int BLEND_EQUATION = 0x8009; + public const int BLEND_EQUATION_RGB = 0x8009; + public const int BLEND_EQUATION_ALPHA = 0x883D; + public const int BLEND_DST_RGB = 0x80C8; + public const int BLEND_SRC_RGB = 0x80C9; + public const int BLEND_DST_ALPHA = 0x80CA; + public const int BLEND_SRC_ALPHA = 0x80CB; + public const int BLEND_COLOR = 0x8005; // ------------------------------------------------------------------------------------ // Functions Declaration - Matrix operations // ------------------------------------------------------------------------------------ /// Choose the current matrix to be transformed - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlMatrixMode(int mode); + [DllImport(NativeLibName, EntryPoint = "rlMatrixMode", CallingConvention = CallingConvention.Cdecl)] + public static extern void MatrixMode(int mode); - /// - public static void rlMatrixMode(MatrixMode mode) + /// + public static void MatrixMode(MatrixMode mode) { - rlMatrixMode((int)mode); + MatrixMode((int)mode); } /// Push the current matrix to stack - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlPushMatrix(); + [DllImport(NativeLibName, EntryPoint = "rlPushMatrix", CallingConvention = CallingConvention.Cdecl)] + public static extern void PushMatrix(); /// Pop lattest inserted matrix from stack - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlPopMatrix(); + [DllImport(NativeLibName, EntryPoint = "rlPopMatrix", CallingConvention = CallingConvention.Cdecl)] + public static extern void PopMatrix(); /// Reset current matrix to identity matrix - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlLoadIdentity(); + [DllImport(NativeLibName, EntryPoint = "rlLoadIdentity", CallingConvention = CallingConvention.Cdecl)] + public static extern void LoadIdentity(); /// Multiply the current matrix by a translation matrix - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlTranslatef(float x, float y, float z); + [DllImport(NativeLibName, EntryPoint = "rlTranslatef", CallingConvention = CallingConvention.Cdecl)] + public static extern void Translatef(float x, float y, float z); /// Multiply the current matrix by a rotation matrix - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlRotatef(float angle, float x, float y, float z); + [DllImport(NativeLibName, EntryPoint = "rlRotatef", CallingConvention = CallingConvention.Cdecl)] + public static extern void Rotatef(float angle, float x, float y, float z); /// Multiply the current matrix by a scaling matrix - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlScalef(float x, float y, float z); + [DllImport(NativeLibName, EntryPoint = "rlScalef", CallingConvention = CallingConvention.Cdecl)] + public static extern void Scalef(float x, float y, float z); /// /// Multiply the current matrix by another matrix
- /// Current Matrix can be set via + /// Current Matrix can be set via ///
- [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlMultMatrixf(float* matf); + [DllImport(NativeLibName, EntryPoint = "rlMultMatrixf", CallingConvention = CallingConvention.Cdecl)] + public static extern void MultMatrixf(float* matf); - /// - public static void rlMultMatrixf(Matrix4x4 matf) + /// + public static void MultMatrixf(Matrix4x4 matf) { Float16 f = Raymath.MatrixToFloatV(matf); - rlMultMatrixf(f.v); + MultMatrixf(f.v); } - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlFrustum( + [DllImport(NativeLibName, EntryPoint = "rlFrustum", CallingConvention = CallingConvention.Cdecl)] + public static extern void Frustum( double left, double right, double bottom, @@ -149,8 +149,8 @@ namespace Raylib_cs double zfar ); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlOrtho( + [DllImport(NativeLibName, EntryPoint = "rlOrtho", CallingConvention = CallingConvention.Cdecl)] + public static extern void Ortho( double left, double right, double bottom, @@ -160,8 +160,8 @@ namespace Raylib_cs ); /// Set the viewport area - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlViewport(int x, int y, int width, int height); + [DllImport(NativeLibName, EntryPoint = "rlViewport", CallingConvention = CallingConvention.Cdecl)] + public static extern void Viewport(int x, int y, int width, int height); // ------------------------------------------------------------------------------------ @@ -169,49 +169,49 @@ namespace Raylib_cs // ------------------------------------------------------------------------------------ /// Initialize drawing mode (how to organize vertex) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlBegin(int mode); + [DllImport(NativeLibName, EntryPoint = "rlBegin", CallingConvention = CallingConvention.Cdecl)] + public static extern void Begin(int mode); - public static void rlBegin(DrawMode mode) + public static void Begin(DrawMode mode) { - rlBegin((int)mode); + Begin((int)mode); } /// Finish vertex providing - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnd(); + [DllImport(NativeLibName, EntryPoint = "rlEnd", CallingConvention = CallingConvention.Cdecl)] + public static extern void End(); /// Define one vertex (position) - 2 int - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlVertex2i(int x, int y); + [DllImport(NativeLibName, EntryPoint = "rlVertex2i", CallingConvention = CallingConvention.Cdecl)] + public static extern void Vertex2i(int x, int y); /// Define one vertex (position) - 2 float - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlVertex2f(float x, float y); + [DllImport(NativeLibName, EntryPoint = "rlVertex2f", CallingConvention = CallingConvention.Cdecl)] + public static extern void Vertex2f(float x, float y); /// Define one vertex (position) - 3 float - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlVertex3f(float x, float y, float z); + [DllImport(NativeLibName, EntryPoint = "rlVertex3f", CallingConvention = CallingConvention.Cdecl)] + public static extern void Vertex3f(float x, float y, float z); /// Define one vertex (texture coordinate) - 2 float - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlTexCoord2f(float x, float y); + [DllImport(NativeLibName, EntryPoint = "rlTexCoord2f", CallingConvention = CallingConvention.Cdecl)] + public static extern void TexCoord2f(float x, float y); /// Define one vertex (normal) - 3 float - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlNormal3f(float x, float y, float z); + [DllImport(NativeLibName, EntryPoint = "rlNormal3f", CallingConvention = CallingConvention.Cdecl)] + public static extern void Normal3f(float x, float y, float z); /// Define one vertex (color) - 4 byte - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlColor4ub(byte r, byte g, byte b, byte a); + [DllImport(NativeLibName, EntryPoint = "rlColor4ub", CallingConvention = CallingConvention.Cdecl)] + public static extern void Color4ub(byte r, byte g, byte b, byte a); /// Define one vertex (color) - 3 float - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlColor3f(float x, float y, float z); + [DllImport(NativeLibName, EntryPoint = "rlColor3f", CallingConvention = CallingConvention.Cdecl)] + public static extern void Color3f(float x, float y, float z); /// Define one vertex (color) - 4 float - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlColor4f(float x, float y, float z, float w); + [DllImport(NativeLibName, EntryPoint = "rlColor4f", CallingConvention = CallingConvention.Cdecl)] + public static extern void Color4f(float x, float y, float z, float w); // ------------------------------------------------------------------------------------ @@ -222,214 +222,214 @@ namespace Raylib_cs /// Vertex buffers state /// Enable vertex array (VAO, if supported) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern CBool rlEnableVertexArray(uint vaoId); + [DllImport(NativeLibName, EntryPoint = "rlEnableVertexArray", CallingConvention = CallingConvention.Cdecl)] + public static extern CBool EnableVertexArray(uint vaoId); /// Disable vertex array (VAO, if supported) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableVertexArray(); + [DllImport(NativeLibName, EntryPoint = "rlDisableVertexArray", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableVertexArray(); /// Enable vertex buffer (VBO) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableVertexBuffer(uint id); + [DllImport(NativeLibName, EntryPoint = "rlEnableVertexBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableVertexBuffer(uint id); /// Disable vertex buffer (VBO) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableVertexBuffer(); + [DllImport(NativeLibName, EntryPoint = "rlDisableVertexBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableVertexBuffer(); /// Enable vertex buffer element (VBO element) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableVertexBufferElement(uint id); + [DllImport(NativeLibName, EntryPoint = "rlEnableVertexBufferElement", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableVertexBufferElement(uint id); /// Disable vertex buffer element (VBO element) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableVertexBufferElement(); + [DllImport(NativeLibName, EntryPoint = "rlDisableVertexBufferElement", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableVertexBufferElement(); /// Enable vertex attribute index - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableVertexAttribute(uint index); + [DllImport(NativeLibName, EntryPoint = "rlEnableVertexAttribute", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableVertexAttribute(uint index); /// Disable vertex attribute index - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableVertexAttribute(uint index); + [DllImport(NativeLibName, EntryPoint = "rlDisableVertexAttribute", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableVertexAttribute(uint index); /// Enable attribute state pointer
/// NOTE: Only available for GRAPHICS_API_OPENGL_11
- [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableStatePointer(int vertexAttribType, void* buffer); + [DllImport(NativeLibName, EntryPoint = "rlEnableStatePointer", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableStatePointer(int vertexAttribType, void* buffer); /// Disable attribute state pointer
/// NOTE: Only available for GRAPHICS_API_OPENGL_11
- [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableStatePointer(int vertexAttribType); + [DllImport(NativeLibName, EntryPoint = "rlDisableStatePointer", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableStatePointer(int vertexAttribType); // Textures state /// Select and active a texture slot - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlActiveTextureSlot(int slot); + [DllImport(NativeLibName, EntryPoint = "rlActiveTextureSlot", CallingConvention = CallingConvention.Cdecl)] + public static extern void ActiveTextureSlot(int slot); /// Enable texture - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableTexture(uint id); + [DllImport(NativeLibName, EntryPoint = "rlEnableTexture", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableTexture(uint id); /// Disable texture - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableTexture(); + [DllImport(NativeLibName, EntryPoint = "rlDisableTexture", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableTexture(); /// Enable texture cubemap - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableTextureCubemap(uint id); + [DllImport(NativeLibName, EntryPoint = "rlEnableTextureCubemap", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableTextureCubemap(uint id); /// Disable texture cubemap - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableTextureCubemap(); + [DllImport(NativeLibName, EntryPoint = "rlDisableTextureCubemap", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableTextureCubemap(); /// Set texture parameters (filter, wrap) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlTextureParameters(uint id, int param, int value); + [DllImport(NativeLibName, EntryPoint = "rlTextureParameters", CallingConvention = CallingConvention.Cdecl)] + public static extern void TextureParameters(uint id, int param, int value); /// Set cubemap parameters (filter, wrap) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlCubemapParameters(uint id, int param, int value); + [DllImport(NativeLibName, EntryPoint = "rlCubemapParameters", CallingConvention = CallingConvention.Cdecl)] + public static extern void CubemapParameters(uint id, int param, int value); // Shader state /// Enable shader program - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableShader(uint id); + [DllImport(NativeLibName, EntryPoint = "rlEnableShader", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableShader(uint id); /// Disable shader program - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableShader(); + [DllImport(NativeLibName, EntryPoint = "rlDisableShader", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableShader(); // Framebuffer state /// Enable render texture (fbo) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableFramebuffer(uint id); + [DllImport(NativeLibName, EntryPoint = "rlEnableFramebuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableFramebuffer(uint id); /// Disable render texture (fbo), return to default framebuffer - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableFramebuffer(); + [DllImport(NativeLibName, EntryPoint = "rlDisableFramebuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableFramebuffer(); /// Activate multiple draw color buffers - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlActiveDrawBuffers(int count); + [DllImport(NativeLibName, EntryPoint = "rlActiveDrawBuffers", CallingConvention = CallingConvention.Cdecl)] + public static extern void ActiveDrawBuffers(int count); // General render state /// Enable color blending - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableColorBlend(); + [DllImport(NativeLibName, EntryPoint = "rlEnableColorBlend", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableColorBlend(); /// Disable color blending - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableColorBlend(); + [DllImport(NativeLibName, EntryPoint = "rlDisableColorBlend", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableColorBlend(); /// Enable depth test - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableDepthTest(); + [DllImport(NativeLibName, EntryPoint = "rlEnableDepthTest", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableDepthTest(); /// Disable depth test - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableDepthTest(); + [DllImport(NativeLibName, EntryPoint = "rlDisableDepthTest", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableDepthTest(); /// Enable depth write - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableDepthMask(); + [DllImport(NativeLibName, EntryPoint = "rlEnableDepthMask", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableDepthMask(); /// Disable depth write - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableDepthMask(); + [DllImport(NativeLibName, EntryPoint = "rlDisableDepthMask", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableDepthMask(); /// Enable backface culling - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableBackfaceCulling(); + [DllImport(NativeLibName, EntryPoint = "rlEnableBackfaceCulling", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableBackfaceCulling(); /// Disable backface culling - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableBackfaceCulling(); + [DllImport(NativeLibName, EntryPoint = "rlDisableBackfaceCulling", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableBackfaceCulling(); /// Set face culling mode - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetCullFace(int mode); + [DllImport(NativeLibName, EntryPoint = "rlSetCullFace", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetCullFace(int mode); /// Enable scissor test - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableScissorTest(); + [DllImport(NativeLibName, EntryPoint = "rlEnableScissorTest", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableScissorTest(); /// Disable scissor test - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableScissorTest(); + [DllImport(NativeLibName, EntryPoint = "rlDisableScissorTest", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableScissorTest(); /// Scissor test - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlScissor(int x, int y, int width, int height); + [DllImport(NativeLibName, EntryPoint = "rlScissor", CallingConvention = CallingConvention.Cdecl)] + public static extern void Scissor(int x, int y, int width, int height); /// Enable wire mode - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableWireMode(); + [DllImport(NativeLibName, EntryPoint = "rlEnableWireMode", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableWireMode(); /// Disable wire mode - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableWireMode(); + [DllImport(NativeLibName, EntryPoint = "rlDisableWireMode", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableWireMode(); /// Set the line drawing width - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetLineWidth(float width); + [DllImport(NativeLibName, EntryPoint = "rlSetLineWidth", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetLineWidth(float width); /// Get the line drawing width - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern float rlGetLineWidth(); + [DllImport(NativeLibName, EntryPoint = "rlGetLineWidth", CallingConvention = CallingConvention.Cdecl)] + public static extern float GetLineWidth(); /// Enable line aliasing - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableSmoothLines(); + [DllImport(NativeLibName, EntryPoint = "rlEnableSmoothLines", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableSmoothLines(); /// Disable line aliasing - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableSmoothLines(); + [DllImport(NativeLibName, EntryPoint = "rlDisableSmoothLines", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableSmoothLines(); /// Enable stereo rendering - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlEnableStereoRender(); + [DllImport(NativeLibName, EntryPoint = "rlEnableStereoRender", CallingConvention = CallingConvention.Cdecl)] + public static extern void EnableStereoRender(); /// Disable stereo rendering - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDisableStereoRender(); + [DllImport(NativeLibName, EntryPoint = "rlDisableStereoRender", CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableStereoRender(); /// Check if stereo render is enabled - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern CBool rlIsStereoRenderEnabled(); + [DllImport(NativeLibName, EntryPoint = "rlIsStereoRenderEnabled", CallingConvention = CallingConvention.Cdecl)] + public static extern CBool IsStereoRenderEnabled(); /// Clear color buffer with color - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlClearColor(byte r, byte g, byte b, byte a); + [DllImport(NativeLibName, EntryPoint = "rlClearColor", CallingConvention = CallingConvention.Cdecl)] + public static extern void ClearColor(byte r, byte g, byte b, byte a); /// Clear used screen buffers (color and depth) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlClearScreenBuffers(); + [DllImport(NativeLibName, EntryPoint = "rlClearScreenBuffers", CallingConvention = CallingConvention.Cdecl)] + public static extern void ClearScreenBuffers(); /// Check and log OpenGL error codes - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlCheckErrors(); + [DllImport(NativeLibName, EntryPoint = "rlCheckErrors", CallingConvention = CallingConvention.Cdecl)] + public static extern void CheckErrors(); /// Set blending mode - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetBlendMode(BlendMode mode); + [DllImport(NativeLibName, EntryPoint = "rlSetBlendMode", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetBlendMode(BlendMode mode); /// Set blending mode factor and equation (using OpenGL factors) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation); + [DllImport(NativeLibName, EntryPoint = "rlSetBlendFactors", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation); /// Set blending mode factors and equations separately (using OpenGL factors) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetBlendFactorsSeparate( + [DllImport(NativeLibName, EntryPoint = "rlSetBlendFactorsSeparate", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetBlendFactorsSeparate( int glSrcRGB, int glDstRGB, int glSrcAlpha, @@ -444,104 +444,104 @@ namespace Raylib_cs // ------------------------------------------------------------------------------------ /// Initialize rlgl (buffers, shaders, textures, states) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlglInit(int width, int height); + [DllImport(NativeLibName, EntryPoint = "rlglInit", CallingConvention = CallingConvention.Cdecl)] + public static extern void glInit(int width, int height); /// De-inititialize rlgl (buffers, shaders, textures) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlglClose(); + [DllImport(NativeLibName, EntryPoint = "rlglClose", CallingConvention = CallingConvention.Cdecl)] + public static extern void glClose(); /// Load OpenGL extensions - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlLoadExtensions(void* loader); + [DllImport(NativeLibName, EntryPoint = "rlLoadExtensions", CallingConvention = CallingConvention.Cdecl)] + public static extern void LoadExtensions(void* loader); /// Get current OpenGL version - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern GlVersion rlGetVersion(); + [DllImport(NativeLibName, EntryPoint = "rlGetVersion", CallingConvention = CallingConvention.Cdecl)] + public static extern GlVersion GetVersion(); /// Get default framebuffer width - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern int rlGetFramebufferWidth(); + [DllImport(NativeLibName, EntryPoint = "rlGetFramebufferWidth", CallingConvention = CallingConvention.Cdecl)] + public static extern int GetFramebufferWidth(); /// Get default framebuffer height - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern int rlGetFramebufferHeight(); + [DllImport(NativeLibName, EntryPoint = "rlGetFramebufferHeight", CallingConvention = CallingConvention.Cdecl)] + public static extern int GetFramebufferHeight(); /// Get default texture - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlGetTextureIdDefault(); + [DllImport(NativeLibName, EntryPoint = "rlGetTextureIdDefault", CallingConvention = CallingConvention.Cdecl)] + public static extern uint GetTextureIdDefault(); /// Get default shader - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlGetShaderIdDefault(); + [DllImport(NativeLibName, EntryPoint = "rlGetShaderIdDefault", CallingConvention = CallingConvention.Cdecl)] + public static extern uint GetShaderIdDefault(); /// Get default shader locations - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern int* rlGetShaderLocsDefault(); + [DllImport(NativeLibName, EntryPoint = "rlGetShaderLocsDefault", CallingConvention = CallingConvention.Cdecl)] + public static extern int* GetShaderLocsDefault(); // Render batch management /// Load a render batch system
/// NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode
/// but this render batch API is exposed in case custom batches are required
- [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern RenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements); + [DllImport(NativeLibName, EntryPoint = "rlLoadRenderBatch", CallingConvention = CallingConvention.Cdecl)] + public static extern RenderBatch LoadRenderBatch(int numBuffers, int bufferElements); /// Unload render batch system - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUnloadRenderBatch(RenderBatch batch); + [DllImport(NativeLibName, EntryPoint = "rlUnloadRenderBatch", CallingConvention = CallingConvention.Cdecl)] + public static extern void UnloadRenderBatch(RenderBatch batch); /// Draw render batch data (Update->Draw->Reset) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDrawRenderBatch(RenderBatch* batch); + [DllImport(NativeLibName, EntryPoint = "rlDrawRenderBatch", CallingConvention = CallingConvention.Cdecl)] + public static extern void DrawRenderBatch(RenderBatch* batch); /// Set the active render batch for rlgl (NULL for default internal) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetRenderBatchActive(RenderBatch* batch); + [DllImport(NativeLibName, EntryPoint = "rlSetRenderBatchActive", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetRenderBatchActive(RenderBatch* batch); /// Update and draw internal render batch - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDrawRenderBatchActive(); + [DllImport(NativeLibName, EntryPoint = "rlDrawRenderBatchActive", CallingConvention = CallingConvention.Cdecl)] + public static extern void DrawRenderBatchActive(); /// Check internal buffer overflow for a given number of vertex - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern CBool rlCheckRenderBatchLimit(int vCount); + [DllImport(NativeLibName, EntryPoint = "rlCheckRenderBatchLimit", CallingConvention = CallingConvention.Cdecl)] + public static extern CBool CheckRenderBatchLimit(int vCount); /// Set current texture for render batch and check buffers limits - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetTexture(uint id); + [DllImport(NativeLibName, EntryPoint = "rlSetTexture", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetTexture(uint id); // Vertex buffers management /// Load vertex array (vao) if supported - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadVertexArray(); + [DllImport(NativeLibName, EntryPoint = "rlLoadVertexArray", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadVertexArray(); /// Load a vertex buffer attribute - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadVertexBuffer(void* buffer, int size, CBool dynamic); + [DllImport(NativeLibName, EntryPoint = "rlLoadVertexBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadVertexBuffer(void* buffer, int size, CBool dynamic); /// Load a new attributes element buffer - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadVertexBufferElement(void* buffer, int size, CBool dynamic); + [DllImport(NativeLibName, EntryPoint = "rlLoadVertexBufferElement", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadVertexBufferElement(void* buffer, int size, CBool dynamic); /// Update GPU buffer with new data - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUpdateVertexBuffer(uint bufferId, void* data, int dataSize, int offset); + [DllImport(NativeLibName, EntryPoint = "rlUpdateVertexBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void UpdateVertexBuffer(uint bufferId, void* data, int dataSize, int offset); /// Update vertex buffer elements with new data - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUpdateVertexBufferElements(uint id, void* data, int dataSize, int offset); + [DllImport(NativeLibName, EntryPoint = "rlUpdateVertexBufferElements", CallingConvention = CallingConvention.Cdecl)] + public static extern void UpdateVertexBufferElements(uint id, void* data, int dataSize, int offset); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUnloadVertexArray(uint vaoId); + [DllImport(NativeLibName, EntryPoint = "rlUnloadVertexArray", CallingConvention = CallingConvention.Cdecl)] + public static extern void UnloadVertexArray(uint vaoId); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUnloadVertexBuffer(uint vboId); + [DllImport(NativeLibName, EntryPoint = "rlUnloadVertexBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void UnloadVertexBuffer(uint vboId); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetVertexAttribute( + [DllImport(NativeLibName, EntryPoint = "rlSetVertexAttribute", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetVertexAttribute( uint index, int compSize, int type, @@ -550,24 +550,24 @@ namespace Raylib_cs void* pointer ); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetVertexAttributeDivisor(uint index, int divisor); + [DllImport(NativeLibName, EntryPoint = "rlSetVertexAttributeDivisor", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetVertexAttributeDivisor(uint index, int divisor); /// Set vertex attribute default value - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetVertexAttributeDefault(int locIndex, void* value, int attribType, int count); + [DllImport(NativeLibName, EntryPoint = "rlSetVertexAttributeDefault", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetVertexAttributeDefault(int locIndex, void* value, int attribType, int count); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDrawVertexArray(int offset, int count); + [DllImport(NativeLibName, EntryPoint = "rlDrawVertexArray", CallingConvention = CallingConvention.Cdecl)] + public static extern void DrawVertexArray(int offset, int count); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDrawVertexArrayElements(int offset, int count, void* buffer); + [DllImport(NativeLibName, EntryPoint = "rlDrawVertexArrayElements", CallingConvention = CallingConvention.Cdecl)] + public static extern void DrawVertexArrayElements(int offset, int count, void* buffer); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDrawVertexArrayInstanced(int offset, int count, int instances); + [DllImport(NativeLibName, EntryPoint = "rlDrawVertexArrayInstanced", CallingConvention = CallingConvention.Cdecl)] + public static extern void DrawVertexArrayInstanced(int offset, int count, int instances); - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlDrawVertexArrayElementsInstanced( + [DllImport(NativeLibName, EntryPoint = "rlDrawVertexArrayElementsInstanced", CallingConvention = CallingConvention.Cdecl)] + public static extern void DrawVertexArrayElementsInstanced( int offset, int count, void* buffer, @@ -578,20 +578,20 @@ namespace Raylib_cs // Textures data management /// Load texture in GPU - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadTexture(void* data, int width, int height, PixelFormat format, int mipmapCount); + [DllImport(NativeLibName, EntryPoint = "rlLoadTexture", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadTexture(void* data, int width, int height, PixelFormat format, int mipmapCount); /// Load depth texture/renderbuffer (to be attached to fbo) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadTextureDepth(int width, int height, CBool useRenderBuffer); + [DllImport(NativeLibName, EntryPoint = "rlLoadTextureDepth", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadTextureDepth(int width, int height, CBool useRenderBuffer); /// Load texture cubemap - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadTextureCubemap(void* data, int size, PixelFormat format); + [DllImport(NativeLibName, EntryPoint = "rlLoadTextureCubemap", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadTextureCubemap(void* data, int size, PixelFormat format); /// Update GPU texture with new data - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUpdateTexture( + [DllImport(NativeLibName, EntryPoint = "rlUpdateTexture", CallingConvention = CallingConvention.Cdecl)] + public static extern void UpdateTexture( uint id, int offsetX, int offsetY, @@ -602,8 +602,8 @@ namespace Raylib_cs ); /// Get OpenGL internal formats - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlGetGlTextureFormats( + [DllImport(NativeLibName, EntryPoint = "rlGetGlTextureFormats", CallingConvention = CallingConvention.Cdecl)] + public static extern void GetGlTextureFormats( PixelFormat format, int* glInternalFormat, int* glFormat, @@ -611,35 +611,35 @@ namespace Raylib_cs ); /// Get OpenGL internal formats - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern sbyte* rlGetPixelFormatName(PixelFormat format); + [DllImport(NativeLibName, EntryPoint = "rlGetPixelFormatName", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte* GetPixelFormatName(PixelFormat format); /// Unload texture from GPU memory - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUnloadTexture(uint id); + [DllImport(NativeLibName, EntryPoint = "rlUnloadTexture", CallingConvention = CallingConvention.Cdecl)] + public static extern void UnloadTexture(uint id); /// Generate mipmap data for selected texture - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlGenTextureMipmaps(uint id, int width, int height, PixelFormat format, int* mipmaps); + [DllImport(NativeLibName, EntryPoint = "rlGenTextureMipmaps", CallingConvention = CallingConvention.Cdecl)] + public static extern void GenTextureMipmaps(uint id, int width, int height, PixelFormat format, int* mipmaps); /// Read texture pixel data - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void* rlReadTexturePixels(uint id, int width, int height, PixelFormat format); + [DllImport(NativeLibName, EntryPoint = "rlReadTexturePixels", CallingConvention = CallingConvention.Cdecl)] + public static extern void* ReadTexturePixels(uint id, int width, int height, PixelFormat format); /// Read screen pixel data (color buffer) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern byte* rlReadScreenPixels(int width, int height); + [DllImport(NativeLibName, EntryPoint = "rlReadScreenPixels", CallingConvention = CallingConvention.Cdecl)] + public static extern byte* ReadScreenPixels(int width, int height); // Framebuffer management (fbo) /// Load an empty framebuffer - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadFramebuffer(int width, int height); + [DllImport(NativeLibName, EntryPoint = "rlLoadFramebuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadFramebuffer(int width, int height); /// Attach texture/renderbuffer to a framebuffer - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlFramebufferAttach( + [DllImport(NativeLibName, EntryPoint = "rlFramebufferAttach", CallingConvention = CallingConvention.Cdecl)] + public static extern void FramebufferAttach( uint fboId, uint texId, FramebufferAttachType attachType, @@ -648,94 +648,94 @@ namespace Raylib_cs ); /// Verify framebuffer is complete - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern CBool rlFramebufferComplete(uint id); + [DllImport(NativeLibName, EntryPoint = "rlFramebufferComplete", CallingConvention = CallingConvention.Cdecl)] + public static extern CBool FramebufferComplete(uint id); /// Delete framebuffer from GPU - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUnloadFramebuffer(uint id); + [DllImport(NativeLibName, EntryPoint = "rlUnloadFramebuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void UnloadFramebuffer(uint id); // Shaders management /// Load shader from code strings - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadShaderCode(sbyte* vsCode, sbyte* fsCode); + [DllImport(NativeLibName, EntryPoint = "rlLoadShaderCode", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadShaderCode(sbyte* vsCode, sbyte* fsCode); /// Compile custom shader and return shader id
- /// (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
- [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlCompileShader(sbyte* shaderCode, int type); + /// (type: VERTEX_SHADER, FRAGMENT_SHADER, COMPUTE_SHADER) + [DllImport(NativeLibName, EntryPoint = "rlCompileShader", CallingConvention = CallingConvention.Cdecl)] + public static extern uint CompileShader(sbyte* shaderCode, int type); /// Load custom shader program - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadShaderProgram(uint vShaderId, uint fShaderId); + [DllImport(NativeLibName, EntryPoint = "rlLoadShaderProgram", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadShaderProgram(uint vShaderId, uint fShaderId); /// Unload shader program - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUnloadShaderProgram(uint id); + [DllImport(NativeLibName, EntryPoint = "rlUnloadShaderProgram", CallingConvention = CallingConvention.Cdecl)] + public static extern void UnloadShaderProgram(uint id); /// Get shader location uniform - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern int rlGetLocationUniform(uint shaderId, sbyte* uniformName); + [DllImport(NativeLibName, EntryPoint = "rlGetLocationUniform", CallingConvention = CallingConvention.Cdecl)] + public static extern int GetLocationUniform(uint shaderId, sbyte* uniformName); /// Get shader location attribute - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern int rlGetLocationAttrib(uint shaderId, sbyte* attribName); + [DllImport(NativeLibName, EntryPoint = "rlGetLocationAttrib", CallingConvention = CallingConvention.Cdecl)] + public static extern int GetLocationAttrib(uint shaderId, sbyte* attribName); /// Set shader value uniform - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetUniform(int locIndex, void* value, int uniformType, int count); + [DllImport(NativeLibName, EntryPoint = "rlSetUniform", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetUniform(int locIndex, void* value, int uniformType, int count); /// Set shader value matrix - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetUniformMatrix(int locIndex, Matrix4x4 mat); + [DllImport(NativeLibName, EntryPoint = "rlSetUniformMatrix", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetUniformMatrix(int locIndex, Matrix4x4 mat); /// Set shader value sampler - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetUniformSampler(int locIndex, uint textureId); + [DllImport(NativeLibName, EntryPoint = "rlSetUniformSampler", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetUniformSampler(int locIndex, uint textureId); /// Set shader currently active (id and locations) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetShader(uint id, int* locs); + [DllImport(NativeLibName, EntryPoint = "rlSetShader", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetShader(uint id, int* locs); // Compute shader management /// Load compute shader program - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadComputeShaderProgram(uint shaderId); + [DllImport(NativeLibName, EntryPoint = "rlLoadComputeShaderProgram", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadComputeShaderProgram(uint shaderId); /// Dispatch compute shader (equivalent to *draw* for graphics pilepine) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlComputeShaderDispatch(uint groupX, uint groupY, uint groupZ); + [DllImport(NativeLibName, EntryPoint = "rlComputeShaderDispatch", CallingConvention = CallingConvention.Cdecl)] + public static extern void ComputeShaderDispatch(uint groupX, uint groupY, uint groupZ); // Shader buffer storage object management (ssbo) /// Load shader storage buffer object (SSBO) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlLoadShaderBuffer(uint size, void* data, int usageHint); + [DllImport(NativeLibName, EntryPoint = "rlLoadShaderBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern uint LoadShaderBuffer(uint size, void* data, int usageHint); /// Unload shader storage buffer object (SSBO) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUnloadShaderBuffer(uint ssboId); + [DllImport(NativeLibName, EntryPoint = "rlUnloadShaderBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void UnloadShaderBuffer(uint ssboId); /// Update SSBO buffer data - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlUpdateShaderBuffer(uint id, void* data, uint dataSize, uint offset); + [DllImport(NativeLibName, EntryPoint = "rlUpdateShaderBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void UpdateShaderBuffer(uint id, void* data, uint dataSize, uint offset); /// Bind SSBO buffer data - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlBindShaderBuffer(uint id, uint index); + [DllImport(NativeLibName, EntryPoint = "rlBindShaderBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void BindShaderBuffer(uint id, uint index); /// Read SSBO buffer data (GPU->CPU) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlReadShaderBuffer(uint id, void* dest, uint count, uint offset); + [DllImport(NativeLibName, EntryPoint = "rlReadShaderBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void ReadShaderBuffer(uint id, void* dest, uint count, uint offset); /// Copy SSBO data between buffers - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlCopyShaderBuffer( + [DllImport(NativeLibName, EntryPoint = "rlCopyShaderBuffer", CallingConvention = CallingConvention.Cdecl)] + public static extern void CopyShaderBuffer( uint destId, uint srcId, uint destOffset, @@ -744,65 +744,64 @@ namespace Raylib_cs ); /// Get SSBO buffer size - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern uint rlGetShaderBufferSize(uint id); + [DllImport(NativeLibName, EntryPoint = "rlGetShaderBufferSize", CallingConvention = CallingConvention.Cdecl)] + public static extern uint GetShaderBufferSize(uint id); // Buffer management /// Bind image texture - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlBindImageTexture(uint id, uint index, int format, CBool readOnly); + [DllImport(NativeLibName, EntryPoint = "rlBindImageTexture", CallingConvention = CallingConvention.Cdecl)] + public static extern void BindImageTexture(uint id, uint index, int format, CBool readOnly); // Matrix state management /// Get internal modelview matrix - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern Matrix4x4 rlGetMatrixModelview(); + [DllImport(NativeLibName, EntryPoint = "rlGetMatrixModelview", CallingConvention = CallingConvention.Cdecl)] + public static extern Matrix4x4 GetMatrixModelview(); /// Get internal projection matrix - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern Matrix4x4 rlGetMatrixProjection(); + [DllImport(NativeLibName, EntryPoint = "rlGetMatrixProjection", CallingConvention = CallingConvention.Cdecl)] + public static extern Matrix4x4 GetMatrixProjection(); /// Get internal accumulated transform matrix - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern Matrix4x4 rlGetMatrixTransform(); + [DllImport(NativeLibName, EntryPoint = "rlGetMatrixTransform", CallingConvention = CallingConvention.Cdecl)] + public static extern Matrix4x4 GetMatrixTransform(); /// Get internal projection matrix for stereo render (selected eye) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern Matrix4x4 rlGetMatrixProjectionStereo(int eye); + [DllImport(NativeLibName, EntryPoint = "rlGetMatrixProjectionStereo", CallingConvention = CallingConvention.Cdecl)] + public static extern Matrix4x4 GetMatrixProjectionStereo(int eye); /// Get internal view offset matrix for stereo render (selected eye) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern Matrix4x4 rlGetMatrixViewOffsetStereo(int eye); + [DllImport(NativeLibName, EntryPoint = "rlGetMatrixViewOffsetStereo", CallingConvention = CallingConvention.Cdecl)] + public static extern Matrix4x4 GetMatrixViewOffsetStereo(int eye); /// Set a custom projection matrix (replaces internal projection matrix) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetMatrixProjection(Matrix4x4 view); + [DllImport(NativeLibName, EntryPoint = "rlSetMatrixProjection", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetMatrixProjection(Matrix4x4 view); /// Set a custom modelview matrix (replaces internal modelview matrix) - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetMatrixModelview(Matrix4x4 proj); + [DllImport(NativeLibName, EntryPoint = "rlSetMatrixModelview", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetMatrixModelView(Matrix4x4 proj); /// Set eyes projection matrices for stereo rendering - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetMatrixProjectionStereo(Matrix4x4 left, Matrix4x4 right); + [DllImport(NativeLibName, EntryPoint = "rlSetMatrixProjectionStereo", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetMatrixProjectionStereo(Matrix4x4 left, Matrix4x4 right); /// Set eyes view offsets matrices for stereo rendering - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlSetMatrixViewOffsetStereo(Matrix4x4 left, Matrix4x4 right); + [DllImport(NativeLibName, EntryPoint = "rlSetMatrixViewOffsetStereo", CallingConvention = CallingConvention.Cdecl)] + public static extern void SetMatrixViewOffsetStereo(Matrix4x4 left, Matrix4x4 right); // Quick and dirty cube/quad buffers load->draw->unload /// Load and draw a cube - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlLoadDrawCube(); + [DllImport(NativeLibName, EntryPoint = "rlLoadDrawCube", CallingConvention = CallingConvention.Cdecl)] + public static extern void LoadDrawCube(); /// Load and draw a quad - [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void rlLoadDrawQuad(); + [DllImport(NativeLibName, EntryPoint = "rlLoadDrawQuad", CallingConvention = CallingConvention.Cdecl)] + public static extern void LoadDrawQuad(); } } -