From 23ed54cc2455f6527be72ff86f90f2b8bdc8c5af Mon Sep 17 00:00:00 2001 From: Chris Dill Date: Mon, 14 Aug 2023 21:33:48 +0100 Subject: [PATCH] BREAKING: Update names of methods, variables, and other elements (#181) Breaking change to update naming across Raylib-cs to make it more consistent with C# naming conventions. --------- Co-authored-by: MrScautHD <65916181+MrScautHD@users.noreply.github.com> --- Raylib-cs.Tests/BlittableHelper.cs | 4 +- Raylib-cs/Raylib-cs.csproj | 2 +- Raylib-cs/interop/Raylib.cs | 1060 ++++++++--------- Raylib-cs/interop/Raymath.cs | 234 ++-- Raylib-cs/interop/Rlgl.cs | 722 +++++------ Raylib-cs/types/Audio.cs | 34 +- Raylib-cs/types/BoundingBox.cs | 8 +- Raylib-cs/types/Camera2D.cs | 16 +- Raylib-cs/types/Camera3D.cs | 22 +- Raylib-cs/types/Color.cs | 26 +- Raylib-cs/types/Font.cs | 23 +- Raylib-cs/types/Image.cs | 11 +- Raylib-cs/types/Input.cs | 40 +- Raylib-cs/types/Logging.cs | 46 +- Raylib-cs/types/Material.cs | 13 +- Raylib-cs/types/Mesh.cs | 32 +- Raylib-cs/types/Model.cs | 70 +- Raylib-cs/types/NPatchInfo.cs | 12 +- Raylib-cs/types/Ray.cs | 16 +- Raylib-cs/types/Raylib.Utils.cs | 58 +- Raylib-cs/types/Rectangle.cs | 18 +- Raylib-cs/types/RenderBatch.cs | 34 +- Raylib-cs/types/RenderTexture2D.cs | 6 +- Raylib-cs/types/Shader.cs | 5 +- Raylib-cs/types/Texture2D.cs | 10 +- Raylib-cs/types/Transform.cs | 6 +- Raylib-cs/types/native/AnsiBuffer.cs | 8 +- Raylib-cs/types/native/CBool.cs | 18 +- Raylib-cs/types/native/FilePathList.cs | 7 +- .../native/{UTF8Buffer.cs => Utf8Buffer.cs} | 16 +- 30 files changed, 1282 insertions(+), 1295 deletions(-) rename Raylib-cs/types/native/{UTF8Buffer.cs => Utf8Buffer.cs} (74%) diff --git a/Raylib-cs.Tests/BlittableHelper.cs b/Raylib-cs.Tests/BlittableHelper.cs index 7df12d02..4b9e4975 100644 --- a/Raylib-cs.Tests/BlittableHelper.cs +++ b/Raylib-cs.Tests/BlittableHelper.cs @@ -36,7 +36,7 @@ public static class BlittableHelper { public static bool IsBlittable() { - return IsBlittableCache.Value; + return IsBlittableCache.VALUE; } public static bool IsBlittable(this Type type) @@ -64,7 +64,7 @@ public static bool IsBlittable(this Type type) 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/Raylib-cs.csproj b/Raylib-cs/Raylib-cs.csproj index ae9f06a5..78518fde 100644 --- a/Raylib-cs/Raylib-cs.csproj +++ b/Raylib-cs/Raylib-cs.csproj @@ -54,7 +54,7 @@ - + diff --git a/Raylib-cs/interop/Raylib.cs b/Raylib-cs/interop/Raylib.cs index a4cc090c..be02d6f1 100644 --- a/Raylib-cs/interop/Raylib.cs +++ b/Raylib-cs/interop/Raylib.cs @@ -11,7 +11,7 @@ public static unsafe partial class Raylib /// /// Used by DllImport to load the native library /// - public const string nativeLibName = "raylib"; + public const string NativeLibName = "raylib"; public const string RAYLIB_VERSION = "4.5"; @@ -31,183 +31,183 @@ public static unsafe partial class Raylib // Window-related functions /// Initialize window and OpenGL context - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void InitWindow(int width, int height, sbyte* title); /// Check if KEY_ESCAPE pressed or Close icon pressed - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool WindowShouldClose(); /// Close window and unload OpenGL context - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CloseWindow(); /// Check if window has been initialized successfully - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWindowReady(); /// Check if window is currently fullscreen - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWindowFullscreen(); /// Check if window is currently hidden (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWindowHidden(); /// Check if window is currently minimized (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWindowMinimized(); /// Check if window is currently maximized (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWindowMaximized(); /// Check if window is currently focused (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWindowFocused(); /// Check if window has been resized last frame - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWindowResized(); /// Check if one specific window flag is enabled - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWindowState(ConfigFlags flag); /// Set window configuration state using flags - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool SetWindowState(ConfigFlags flag); /// Clear window configuration state flags - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ClearWindowState(ConfigFlags flag); /// Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ToggleFullscreen(); /// Set window state: maximized, if resizable (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void MaximizeWindow(); /// Set window state: minimized, if resizable (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void MinimizeWindow(); /// Set window state: not minimized/maximized (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void RestoreWindow(); /// Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetWindowIcon(Image image); /// Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetWindowIcons(Image* images, int count); /// Set title for window (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetWindowTitle(sbyte* title); /// Set window position on screen (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetWindowPosition(int x, int y); /// Set monitor for the current window (fullscreen mode) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetWindowMonitor(int monitor); /// Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetWindowMinSize(int width, int height); /// Set window dimensions - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetWindowSize(int width, int height); /// Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetWindowOpacity(float opacity); /// Get native window handle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void* GetWindowHandle(); /// Get current screen width - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetScreenWidth(); /// Get current screen height - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetScreenHeight(); /// Get current render width (it considers HiDPI) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetRenderWidth(); /// Get current render height (it considers HiDPI) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetRenderHeight(); /// Get number of connected monitors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetMonitorCount(); /// Get current connected monitor - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetCurrentMonitor(); /// Get specified monitor position - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetMonitorPosition(int monitor); /// Get specified monitor width - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetMonitorWidth(int monitor); /// Get specified monitor height - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetMonitorHeight(int monitor); /// Get specified monitor physical width in millimetres - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetMonitorPhysicalWidth(int monitor); /// Get specified monitor physical height in millimetres - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetMonitorPhysicalHeight(int monitor); /// Get specified monitor refresh rate - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetMonitorRefreshRate(int monitor); /// Get window position XY on monitor - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetWindowPosition(); /// Get window scale DPI factor - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetWindowScaleDPI(); /// Get the human-readable, UTF-8 encoded name of the specified monitor - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetMonitorName(int monitor); /// Get clipboard text content - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetClipboardText(); /// Set clipboard text content - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetClipboardText(sbyte* text); /// Enable waiting for events on EndDrawing(), no automatic event polling - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EnableEventWaiting(); /// Disable waiting for events on EndDrawing(), automatic events polling - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DisableEventWaiting(); // Custom frame control functions @@ -216,150 +216,150 @@ public static unsafe partial class Raylib // To avoid that behaviour and control frame processes manually, enable in config.h: SUPPORT_CUSTOM_FRAME_CONTROL /// Swap back buffer with front buffer (screen drawing) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SwapScreenBuffer(); /// Register all input events - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void PollInputEvents(); /// Wait for some time (halt program execution) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void WaitTime(double seconds); // Cursor-related functions /// Shows cursor - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ShowCursor(); /// Hides cursor - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void HideCursor(); /// Check if cursor is not visible - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsCursorHidden(); /// Enables cursor (unlock cursor) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EnableCursor(); /// Disables cursor (lock cursor) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DisableCursor(); /// Check if cursor is on the screen - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsCursorOnScreen(); // Drawing-related functions /// Set background color (framebuffer clear color) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ClearBackground(Color color); /// Setup canvas (framebuffer) to start drawing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void BeginDrawing(); /// End canvas drawing and swap buffers (double buffering) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EndDrawing(); /// Initialize 2D mode with custom camera (2D) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void BeginMode2D(Camera2D camera); /// Ends 2D mode with custom camera - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EndMode2D(); /// Initializes 3D mode with custom camera (3D) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void BeginMode3D(Camera3D camera); /// Ends 3D mode and returns to default 2D orthographic mode - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EndMode3D(); /// Initializes render texture for drawing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void BeginTextureMode(RenderTexture2D target); /// Ends drawing to render texture - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EndTextureMode(); /// Begin custom shader drawing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void BeginShaderMode(Shader shader); /// End custom shader drawing (use default shader) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EndShaderMode(); /// Begin blending mode (alpha, additive, multiplied) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void BeginBlendMode(BlendMode mode); /// End blending mode (reset to default: alpha blending) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EndBlendMode(); /// Begin scissor mode (define screen area for following drawing) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void BeginScissorMode(int x, int y, int width, int height); /// End scissor mode - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EndScissorMode(); /// Begin stereo rendering (requires VR simulator) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void BeginVrStereoMode(VrStereoConfig config); /// End stereo rendering (requires VR simulator) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void EndVrStereoMode(); // VR stereo config functions for VR simulator /// Load VR stereo config for VR simulator device parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern VrStereoConfig LoadVrStereoConfig(VrDeviceInfo device); /// Unload VR stereo configs - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadVrStereoConfig(VrStereoConfig config); // Shader management functions /// Load shader from files and bind default locations - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Shader LoadShader(sbyte* vsFileName, sbyte* fsFileName); /// Load shader from code strings and bind default locations - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Shader LoadShaderFromMemory(sbyte* vsCode, sbyte* fsCode); /// Check if a shader is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsShaderReady(Shader shader); /// Get shader uniform location - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetShaderLocation(Shader shader, sbyte* uniformName); /// Get shader attribute location - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetShaderLocationAttrib(Shader shader, sbyte* attribName); /// Set shader uniform value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetShaderValue( Shader shader, int locIndex, @@ -368,7 +368,7 @@ ShaderUniformDataType uniformType ); /// Set shader uniform value vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetShaderValueV( Shader shader, int locIndex, @@ -378,104 +378,104 @@ int count ); /// Set shader uniform value (matrix 4x4) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetShaderValueMatrix(Shader shader, int locIndex, Matrix4x4 mat); /// Set shader uniform value for texture (sampler2d) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture); /// Unload shader from GPU memory (VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadShader(Shader shader); // Screen-space-related functions /// Get a ray trace from mouse position - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Ray GetMouseRay(Vector2 mousePosition, Camera3D camera); /// Get camera transform matrix (view matrix) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 GetCameraMatrix(Camera3D camera); /// Get camera 2d transform matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 GetCameraMatrix2D(Camera2D camera); /// Get the screen space position for a 3d world space position - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetWorldToScreen(Vector3 position, Camera3D camera); /// Get size position for a 3d world space position - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetWorldToScreenEx(Vector3 position, Camera3D camera, int width, int height); /// Get the screen space position for a 2d camera world space position - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); /// Get the world space position for a 2d camera screen space position - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Timing-related functions /// Set target FPS (maximum) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetTargetFPS(int fps); /// Get current FPS - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetFPS(); /// Get time in seconds for last frame drawn - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float GetFrameTime(); /// Get elapsed time in seconds since InitWindow() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern double GetTime(); // Misc. functions /// Get a random value between min and max (both included) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetRandomValue(int min, int max); /// Set the seed for the random number generator - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SetRandomSeed(uint seed); /// Takes a screenshot of current screen (saved a .png) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TakeScreenshot(sbyte* fileName); /// Setup window configuration flags (view FLAGS) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetConfigFlags(ConfigFlags flags); /// Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TraceLog(TraceLogLevel logLevel, sbyte* text); /// Set the current threshold (minimum) log level - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetTraceLogLevel(TraceLogLevel logLevel); /// Internal memory allocator - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void* MemAlloc(int size); /// Internal memory reallocator - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void* MemRealloc(void* ptr, int size); /// Internal memory free - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void MemFree(void* ptr); @@ -483,159 +483,159 @@ int count // WARNING: Callbacks setup is intended for advance users /// Set custom trace log - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetTraceLogCallback(delegate* unmanaged[Cdecl] callback); /// Set custom file binary data loader - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetLoadFileDataCallback(delegate* unmanaged[Cdecl] callback); /// Set custom file binary data saver - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetSaveFileDataCallback( delegate* unmanaged[Cdecl] callback ); /// Set custom file text data loader - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetLoadFileTextCallback(delegate* unmanaged[Cdecl] callback); /// Set custom file text data saver - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetSaveFileTextCallback(delegate* unmanaged[Cdecl] callback); // Files management functions /// Load file data as byte array (read) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern byte* LoadFileData(sbyte* fileName, uint* bytesRead); /// Unload file data allocated by LoadFileData() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadFileData(byte* data); /// Save data to file from byte array (write), returns true on success - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool SaveFileData(sbyte* fileName, void* data, uint bytesToWrite); /// Export data to code (.h), returns true on success - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ExportDataAsCode(byte* data, uint size, sbyte* fileName); // Load text data from file (read), returns a '\0' terminated string - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* LoadFileText(sbyte* fileName); // Unload file text data allocated by LoadFileText() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadFileText(sbyte* text); // Save text data to file (write), string must be '\0' terminated, returns true on success - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool SaveFileText(sbyte* fileName, sbyte* text); // Check if file exists - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool FileExists(sbyte* fileName); // Check if a directory path exists - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool DirectoryExists(sbyte* dirPath); /// Check file extension (including point: .png, .wav) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsFileExtension(sbyte* fileName, sbyte* ext); /// Get file length in bytes - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetFileLength(sbyte* fileName); /// Get pointer to extension for a filename string (includes dot: '.png') - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetFileExtension(sbyte* fileName); /// Get pointer to filename for a path string - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetFileName(sbyte* filePath); /// Get filename string without extension (uses static string) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetFileNameWithoutExt(sbyte* filePath); /// Get full path for a given fileName with path (uses static string) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetDirectoryPath(sbyte* filePath); /// Get previous directory path for a given path (uses static string) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetPrevDirectoryPath(sbyte* dirPath); /// Get current working directory (uses static string) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetWorkingDirectory(); /// Get the directory of the running application (uses static string) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetApplicationDirectory(); /// Load directory filepaths - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern FilePathList LoadDirectoryFiles(sbyte* dirPath, int* count); /// Load directory filepaths with extension filtering and recursive directory scan - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern FilePathList LoadDirectoryFilesEx(sbyte* basePath, sbyte* filter, CBool scanSubdirs); /// Unload filepaths - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadDirectoryFiles(FilePathList files); /// Check if a given path is a file or a directory - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsPathFile(sbyte* path); /// Change working directory, return true on success - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ChangeDirectory(sbyte* dir); /// Check if a file has been dropped into window - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsFileDropped(); /// Load dropped filepaths - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern FilePathList LoadDroppedFiles(); /// Unload dropped filepaths - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadDroppedFiles(FilePathList files); /// Get file modification time (last write time) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern long GetFileModTime(sbyte* fileName); // Compression/Encoding functionality /// Compress data (DEFLATE algorithm), memory must be MemFree() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern byte* CompressData(byte* data, int dataSize, int* compDataSize); /// Decompress data (DEFLATE algorithm), memory must be MemFree() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern byte* DecompressData(byte* compData, int compDataSize, int* dataSize); /// Encode data to Base64 string, memory must be MemFree() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* EncodeDataBase64(byte* data, int dataSize, int* outputSize); /// Decode Base64 string data, memory must be MemFree() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern byte* DecodeDataBase64(byte* data, int* outputSize); /// Open URL with default system browser (if available) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void OpenURL(sbyte* url); //------------------------------------------------------------------------------------ @@ -645,160 +645,160 @@ public static extern void SetSaveFileDataCallback( // Input-related functions: keyboard /// Detect if a key has been pressed once - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsKeyPressed(KeyboardKey key); /// Detect if a key is being pressed - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsKeyDown(KeyboardKey key); /// Detect if a key has been released once - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsKeyReleased(KeyboardKey key); /// Detect if a key is NOT being pressed - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsKeyUp(KeyboardKey key); /// Set a custom key to exit program (default is ESC) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetExitKey(KeyboardKey key); /// /// Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetKeyPressed(); /// /// Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetCharPressed(); // Input-related functions: gamepads /// Detect if a gamepad is available - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsGamepadAvailable(int gamepad); /// Get gamepad internal name id - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* GetGamepadName(int gamepad); /// Detect if a gamepad button has been pressed once - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsGamepadButtonPressed(int gamepad, GamepadButton button); /// Detect if a gamepad button is being pressed - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsGamepadButtonDown(int gamepad, GamepadButton button); /// Detect if a gamepad button has been released once - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsGamepadButtonReleased(int gamepad, GamepadButton button); /// Detect if a gamepad button is NOT being pressed - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsGamepadButtonUp(int gamepad, GamepadButton button); /// Get the last gamepad button pressed - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetGamepadButtonPressed(); /// Get gamepad axis count for a gamepad - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetGamepadAxisCount(int gamepad); /// Get axis movement value for a gamepad axis - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float GetGamepadAxisMovement(int gamepad, GamepadAxis axis); /// Set internal gamepad mappings (SDL_GameControllerDB) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SetGamepadMappings(sbyte* mappings); // Input-related functions: mouse /// Detect if a mouse button has been pressed once - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsMouseButtonPressed(MouseButton button); /// Detect if a mouse button is being pressed - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsMouseButtonDown(MouseButton button); /// Detect if a mouse button has been released once - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsMouseButtonReleased(MouseButton button); /// Detect if a mouse button is NOT being pressed - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsMouseButtonUp(MouseButton button); /// Get mouse position X - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetMouseX(); /// Get mouse position Y - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetMouseY(); /// Get mouse position XY - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetMousePosition(); /// Get mouse delta between frames - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetMouseDelta(); /// Set mouse position XY - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMousePosition(int x, int y); /// Set mouse offset - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMouseOffset(int offsetX, int offsetY); /// Set mouse scaling - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMouseScale(float scaleX, float scaleY); /// Get mouse wheel movement for X or Y, whichever is larger - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float GetMouseWheelMove(); /// Get mouse wheel movement for both X and Y - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetMouseWheelMoveV(); /// Set mouse cursor - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMouseCursor(MouseCursor cursor); // Input-related functions: touch /// Get touch position X for touch point 0 (relative to screen size) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetTouchX(); /// Get touch position Y for touch point 0 (relative to screen size) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetTouchY(); /// Get touch position XY for a touch point index (relative to screen size) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetTouchPosition(int index); /// Get touch point identifier for given index - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetTouchPointId(int index); /// Get number of touch points - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetTouchPointCount(); //------------------------------------------------------------------------------------ @@ -806,35 +806,35 @@ public static extern void SetSaveFileDataCallback( //------------------------------------------------------------------------------------ /// Enable a set of gestures using flags - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetGesturesEnabled(Gesture flags); /// Check if a gesture has been detected - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsGestureDetected(Gesture gesture); /// Get latest detected gesture - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Gesture GetGestureDetected(); /// Get gesture hold time in milliseconds - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float GetGestureHoldDuration(); /// Get gesture drag vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetGestureDragVector(); /// Get gesture drag angle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float GetGestureDragAngle(); /// Get gesture pinch delta - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 GetGesturePinchVector(); /// Get gesture pinch angle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float GetGesturePinchAngle(); @@ -843,45 +843,45 @@ public static extern void SetSaveFileDataCallback( //------------------------------------------------------------------------------------ /// Update camera position for selected mode - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateCamera(Camera3D* camera, CameraMode mode); /// Update camera movement/rotation - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateCameraPro(Camera3D* camera, Vector3 movement, Vector3 rotation, float zoom); /// Returns the cameras forward vector (normalized) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 GetCameraForward(Camera3D* camera); /// /// Returns the cameras up vector (normalized)
/// NOTE: The up vector might not be perpendicular to the forward vector ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 GetCameraUp(Camera3D* camera); /// Returns the cameras right vector (normalized) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 GetCameraRight(Camera3D* camera); // Camera movement /// Moves the camera in its forward direction - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CameraMoveForward(Camera3D* camera, float distance, CBool moveInWorldPlane); /// Moves the camera in its up direction - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CameraMoveUp(Camera3D* camera, float distance); /// Moves the camera target in its current right direction - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CameraMoveRight(Camera3D* camera, float distance, CBool moveInWorldPlane); /// Moves the camera position closer/farther to/from the camera target - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CameraMoveToTarget(Camera3D* camera, float delta); @@ -891,13 +891,13 @@ public static extern void SetSaveFileDataCallback( /// Rotates the camera around its up vector
/// If rotateAroundTarget is false, the camera rotates around its position /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CameraYaw(Camera3D* camera, float angle, CBool rotateAroundTarget); /// /// Rotates the camera around its right vector /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CameraPitch( Camera3D* camera, float angle, @@ -907,15 +907,15 @@ CBool rotateUp ); /// Rotates the camera around its forward vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CameraRoll(Camera3D* camera, float angle); /// Returns the camera view matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 GetCameraViewMatrix(Camera3D* camera); /// Returns the camera projection matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 GetCameraProjectionMatrix(Camera3D* camera, float aspect); @@ -928,37 +928,37 @@ CBool rotateUp /// NOTE: It can be useful when using basic shapes and one single font.
/// Defining a white rectangle would allow drawing everything in a single draw call. /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetShapesTexture(Texture2D texture, Rectangle source); // Basic shapes drawing functions /// Draw a pixel - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawPixel(int posX, int posY, Color color); /// Draw a pixel (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawPixelV(Vector2 position, Color color); /// Draw a line - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); /// Draw a line (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); /// Draw a line defining thickness - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); /// Draw a line using cubic-bezier curves in-out - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); /// Draw line using quadratic bezier curves with a control point - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawLineBezierQuad( Vector2 startPos, Vector2 endPos, @@ -968,7 +968,7 @@ Color color ); /// Draw line using cubic bezier curves with 2 control points - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawLineBezierCubic( Vector2 startPos, Vector2 endPos, @@ -979,15 +979,15 @@ Color color ); /// Draw lines sequence - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawLineStrip(Vector2* points, int pointCount, Color color); /// Draw a color-filled circle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCircle(int centerX, int centerY, float radius, Color color); /// Draw a piece of a circle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCircleSector( Vector2 center, float radius, @@ -998,7 +998,7 @@ Color color ); /// Draw circle sector outline - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCircleSectorLines( Vector2 center, float radius, @@ -1009,7 +1009,7 @@ Color color ); /// Draw a gradient-filled circle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCircleGradient( int centerX, int centerY, @@ -1019,23 +1019,23 @@ Color color2 ); /// Draw a color-filled circle (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCircleV(Vector2 center, float radius, Color color); /// Draw circle outline - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCircleLines(int centerX, int centerY, float radius, Color color); /// Draw ellipse - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color); /// Draw ellipse outline - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color); /// Draw ring - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRing( Vector2 center, float innerRadius, @@ -1047,7 +1047,7 @@ Color color ); /// Draw ring outline - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRingLines( Vector2 center, float innerRadius, @@ -1059,23 +1059,23 @@ Color color ); /// Draw a color-filled rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangle(int posX, int posY, int width, int height, Color color); /// Draw a color-filled rectangle (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleV(Vector2 position, Vector2 size, Color color); /// Draw a color-filled rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleRec(Rectangle rec, Color color); /// Draw a color-filled rectangle with pro parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); /// Draw a vertical-gradient-filled rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleGradientV( int posX, int posY, @@ -1086,7 +1086,7 @@ Color color2 ); /// Draw a horizontal-gradient-filled rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleGradientH( int posX, int posY, @@ -1097,7 +1097,7 @@ Color color2 ); /// Draw a gradient-filled rectangle with custom vertex colors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleGradientEx( Rectangle rec, Color col1, @@ -1107,19 +1107,19 @@ Color col4 ); /// Draw rectangle outline - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleLines(int posX, int posY, int width, int height, Color color); /// Draw rectangle outline with extended parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleLinesEx(Rectangle rec, float lineThick, Color color); /// Draw rectangle with rounded edges - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); /// Draw rectangle with rounded edges outline - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRectangleRoundedLines( Rectangle rec, float roundness, @@ -1129,31 +1129,31 @@ Color color ); /// Draw a color-filled triangle (vertex in counter-clockwise order!) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); /// Draw triangle outline (vertex in counter-clockwise order!) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); /// Draw a triangle fan defined by points (first vertex is the center) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTriangleFan(Vector2* points, int pointCount, Color color); /// Draw a triangle strip defined by points - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTriangleStrip(Vector2* points, int pointCount, Color color); /// Draw a regular polygon (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); /// Draw a polygon outline of n sides - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawPolyLines(Vector2 center, int sides, float radius, float rotation, Color color); /// Draw a polygon outline of n sides with extended parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawPolyLinesEx( Vector2 center, int sides, @@ -1166,11 +1166,11 @@ Color color // Basic shapes collision detection functions /// Check collision between two rectangles - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); /// Check collision between two circles - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionCircles( Vector2 center1, float radius1, @@ -1179,29 +1179,29 @@ float radius2 ); /// Check collision between circle and rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); /// Check if point is inside rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionPointRec(Vector2 point, Rectangle rec); /// Check if point is inside circle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); /// Check if point is inside a triangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); /// Check if point is within a polygon described by array of vertices - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionPointPoly(Vector2 point, Vector2* points, int pointCount); /// /// Check the collision between two lines defined by two points each, returns collision point by reference /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionLines( Vector2 startPos1, Vector2 endPos1, @@ -1213,11 +1213,11 @@ public static extern CBool CheckCollisionLines( /// /// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold); /// Get collision rectangle for two rectangles collision - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); @@ -1229,11 +1229,11 @@ public static extern CBool CheckCollisionLines( // NOTE: This functions do not require GPU access /// Load image from file into CPU memory (RAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image LoadImage(sbyte* fileName); /// Load image from RAW file data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image LoadImageRaw( sbyte* fileName, int width, @@ -1243,54 +1243,54 @@ int headerSize ); /// Load image sequence from file (frames appended to image.data) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image LoadImageAnim(sbyte* fileName, int* frames); /// Load image from memory buffer, fileType refers to extension: i.e. "png" - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image LoadImageFromMemory(sbyte* fileType, byte* fileData, int dataSize); /// Load image from GPU texture data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image LoadImageFromTexture(Texture2D texture); /// Load image from screen buffer and (screenshot) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image LoadImageFromScreen(); /// Check if an image is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsImageReady(Image image); /// Unload image from CPU memory (RAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadImage(Image image); /// Export image data to file - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ExportImage(Image image, sbyte* fileName); /// Export image as code file defining an array of bytes - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ExportImageAsCode(Image image, sbyte* fileName); // Image generation functions /// Generate image: plain color - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageColor(int width, int height, Color color); /// Generate image: vertical gradient - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageGradientV(int width, int height, Color top, Color bottom); /// Generate image: horizontal gradient - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageGradientH(int width, int height, Color left, Color right); /// Generate image: radial gradient - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageGradientRadial( int width, int height, @@ -1300,7 +1300,7 @@ Color outer ); /// Generate image: checked - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageChecked( int width, int height, @@ -1311,82 +1311,82 @@ Color col2 ); /// Generate image: white noise - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageWhiteNoise(int width, int height, float factor); /// Generate image: perlin noise - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); /// Generate image: cellular algorithm, bigger tileSize means bigger cells - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageCellular(int width, int height, int tileSize); /// Generate image: grayscale image from text data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageText(int width, int height, int tileSize); // Image manipulation functions /// Create an image duplicate (useful for transformations) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image ImageCopy(Image image); /// Create an image from another image piece - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image ImageFromImage(Image image, Rectangle rec); /// Create an image from text (default font) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image ImageText(sbyte* text, int fontSize, Color color); /// Create an image from text (custom sprite font) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image ImageTextEx(Font font, sbyte* text, float fontSize, float spacing, Color tint); /// Convert image data to desired format - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageFormat(Image* image, PixelFormat newFormat); /// Convert image to POT (power-of-two) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageToPOT(Image* image, Color fill); /// Crop an image to a defined rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageCrop(Image* image, Rectangle crop); /// Crop image depending on alpha value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageAlphaCrop(Image* image, float threshold); /// Clear alpha channel to desired color - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageAlphaClear(Image* image, Color color, float threshold); /// Apply alpha mask to image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageAlphaMask(Image* image, Image alphaMask); /// Premultiply alpha channel - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageAlphaPremultiply(Image* image); /// Apply Gaussian blur using a box blur approximation - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageBlurGaussian(Image* image, int blurSize); /// Resize image (Bicubic scaling algorithm) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageResize(Image* image, int newWidth, int newHeight); /// Resize image (Nearest-Neighbor scaling algorithm) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageResizeNN(Image* image, int newWidth, int newHeight); /// Resize canvas and fill with color - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageResizeCanvas( Image* image, int newWidth, @@ -1397,75 +1397,75 @@ Color color ); /// Generate all mipmap levels for a provided image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageMipmaps(Image* image); /// Dither image data to 16bpp or lower (Floyd-Steinberg dithering) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDither(Image* image, int rBpp, int gBpp, int bBpp, int aBpp); /// Flip image vertically - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageFlipVertical(Image* image); /// Flip image horizontally - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageFlipHorizontal(Image* image); /// Rotate image clockwise 90deg - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageRotateCW(Image* image); /// Rotate image counter-clockwise 90deg - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageRotateCCW(Image* image); /// Modify image color: tint - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageColorTint(Image* image, Color color); /// Modify image color: invert - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageColorInvert(Image* image); /// Modify image color: grayscale - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageColorGrayscale(Image* image); /// Modify image color: contrast (-100 to 100) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageColorContrast(Image* image, float contrast); /// Modify image color: brightness (-255 to 255) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageColorBrightness(Image* image, int brightness); /// Modify image color: replace color - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageColorReplace(Image* image, Color color, Color replace); /// Load color data from image as a Color array (RGBA - 32bit) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color* LoadImageColors(Image image); /// Load colors palette from image as a Color array (RGBA - 32bit) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color* LoadImagePalette(Image image, int maxPaletteSize, int* colorCount); /// Unload color data loaded with LoadImageColors() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadImageColors(Color* colors); /// Unload colors palette loaded with LoadImagePalette() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadImagePalette(Color* colors); /// Get image alpha border rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Rectangle GetImageAlphaBorder(Image image, float threshold); /// Get image pixel color at (x, y) position - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color GetImageColor(Image image, int x, int y); @@ -1473,19 +1473,19 @@ Color color // NOTE: Image software-rendering functions (CPU) /// Clear image background with given color - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageClearBackground(Image* dst, Color color); /// Draw pixel within an image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawPixel(Image* dst, int posX, int posY, Color color); /// Draw pixel within an image (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawPixelV(Image* dst, Vector2 position, Color color); /// Draw line within an image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawLine( Image* dst, int startPosX, @@ -1496,27 +1496,27 @@ Color color ); /// Draw line within an image (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawLineV(Image* dst, Vector2 start, Vector2 end, Color color); /// Draw circle within an image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawCircle(Image* dst, int centerX, int centerY, int radius, Color color); /// Draw circle within an image (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawCircleV(Image* dst, Vector2 center, int radius, Color color); /// Draw circle outline within an image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawCircleLines(Image* dst, int centerX, int centerY, int radius, Color color); /// Draw circle outline within an image (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawCircleLinesV(Image* dst, Vector2 center, int radius, Color color); /// Draw rectangle within an image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawRectangle( Image* dst, int posX, @@ -1527,27 +1527,27 @@ Color color ); /// Draw rectangle within an image (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawRectangleV(Image* dst, Vector2 position, Vector2 size, Color color); /// Draw rectangle within an image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawRectangleRec(Image* dst, Rectangle rec, Color color); /// Draw rectangle lines within an image - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawRectangleLines(Image* dst, Rectangle rec, int thick, Color color); /// Draw a source image within a destination image (tint applied to source) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDraw(Image* dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); /// Draw text (using default font) within an image (destination) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawText(Image* dst, sbyte* text, int x, int y, int fontSize, Color color); /// Draw text (custom sprite font) within an image (destination) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ImageDrawTextEx( Image* dst, Font font, @@ -1563,73 +1563,73 @@ Color tint // NOTE: These functions require GPU access /// Load texture from file into GPU memory (VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Texture2D LoadTexture(sbyte* fileName); /// Load texture from image data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Texture2D LoadTextureFromImage(Image image); /// Load cubemap from image, multiple image cubemap layouts supported - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Texture2D LoadTextureCubemap(Image image, CubemapLayout layout); /// Load texture for rendering (framebuffer) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern RenderTexture2D LoadRenderTexture(int width, int height); /// Check if a texture is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsTextureReady(Texture2D texture); /// Unload texture from GPU memory (VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadTexture(Texture2D texture); /// Check if a render texture is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsRenderTextureReady(RenderTexture2D target); /// Unload render texture from GPU memory (VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadRenderTexture(RenderTexture2D target); /// Update GPU texture with new data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateTexture(Texture2D texture, void* pixels); /// Update GPU texture rectangle with new data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateTextureRec(Texture2D texture, Rectangle rec, void* pixels); // Texture configuration functions /// Generate GPU mipmaps for a texture - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void GenTextureMipmaps(Texture2D* texture); /// Set texture scaling filter mode - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetTextureFilter(Texture2D texture, TextureFilter filter); /// Set texture wrapping mode - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetTextureWrap(Texture2D texture, TextureWrap wrap); // Texture drawing functions /// Draw a Texture2D - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTexture(Texture2D texture, int posX, int posY, Color tint); /// Draw a Texture2D with position defined as Vector2 - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTextureV(Texture2D texture, Vector2 position, Color tint); /// Draw a Texture2D with extended parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTextureEx( Texture2D texture, Vector2 position, @@ -1639,11 +1639,11 @@ Color tint ); /// Draw a part of a texture defined by a rectangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTextureRec(Texture2D texture, Rectangle source, Vector2 position, Color tint); /// Draw a part of a texture defined by a rectangle with 'pro' parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTexturePro( Texture2D texture, Rectangle source, @@ -1654,7 +1654,7 @@ Color tint ); /// Draws a texture (or part of it) that stretches or shrinks nicely - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTextureNPatch( Texture2D texture, NPatchInfo nPatchInfo, @@ -1668,59 +1668,59 @@ Color tint // Color/pixel related functions /// Get hexadecimal value for a Color - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int ColorToInt(Color color); /// Get color normalized as float [0..1] - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector4 ColorNormalize(Color color); /// Get color from normalized values [0..1] - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color ColorFromNormalized(Vector4 normalized); /// Get HSV values for a Color, hue [0..360], saturation/value [0..1] - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 ColorToHSV(Color color); /// Get a Color from HSV values, hue [0..360], saturation/value [0..1] - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color ColorFromHSV(float hue, float saturation, float value); /// Get color multiplied with another color - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color ColorTint(Color color, Color tint); /// Get color with brightness correction, brightness factor goes from -1.0f to 1.0f - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color ColorBrightness(Color color, float factor); /// Get color with contrast correction, contrast values between -1.0f and 1.0f - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color ColorContrast(Color color, float contrast); /// Get color with alpha applied, alpha goes from 0.0f to 1.0f - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color ColorAlpha(Color color, float alpha); /// Get src alpha-blended into dst color with tint - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color ColorAlphaBlend(Color dst, Color src, Color tint); /// Get Color structure from hexadecimal value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color GetColor(uint hexValue); /// Get Color from a source pixel pointer of certain format - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Color GetPixelColor(void* srcPtr, PixelFormat format); /// Set color formatted into destination pixel pointer - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetPixelColor(void* dstPtr, Color color, PixelFormat format); /// Get pixel data size in bytes for certain format - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetPixelDataSize(int width, int height, PixelFormat format); @@ -1731,26 +1731,26 @@ Color tint // Font loading/unloading functions /// Get the default Font - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Font GetFontDefault(); /// Load font from file into GPU memory (VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Font LoadFont(sbyte* fileName); /// /// Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load /// the default character set /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Font LoadFontEx(sbyte* fileName, int fontSize, int* fontChars, int glyphCount); /// Load font from Image (XNA style) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Font LoadFontFromImage(Image image, Color key, int firstChar); /// Load font from memory buffer, fileType refers to extension: i.e. "ttf" - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Font LoadFontFromMemory( sbyte* fileType, byte* fileData, @@ -1761,11 +1761,11 @@ int glyphCount ); /// Check if a font is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsFontReady(Font font); /// Load font data for further use - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern GlyphInfo* LoadFontData( byte* fileData, int dataSize, @@ -1776,7 +1776,7 @@ FontType type ); /// Generate image font atlas using chars info - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Image GenImageFontAtlas( GlyphInfo* chars, Rectangle** recs, @@ -1787,30 +1787,30 @@ int packMethod ); /// Unload font chars info data (RAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadFontData(GlyphInfo* chars, int glyphCount); /// Unload Font from GPU memory (VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadFont(Font font); /// Export font as code file, returns true on success - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ExportFontAsCode(Font font, sbyte* fileName); // Text drawing functions /// Shows current FPS - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawFPS(int posX, int posY); /// Draw text (using default font) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawText(sbyte* text, int posX, int posY, int fontSize, Color color); /// Draw text using font and additional parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTextEx( Font font, sbyte* text, @@ -1821,7 +1821,7 @@ Color tint ); /// Draw text using Font and pro parameters (rotation) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTextPro( Font font, sbyte* text, @@ -1834,7 +1834,7 @@ Color tint ); /// Draw one character (codepoint) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTextCodepoint( Font font, int codepoint, @@ -1844,7 +1844,7 @@ Color tint ); /// Draw multiple characters (codepoint) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTextCodepoints( Font font, int* codepoints, @@ -1858,68 +1858,68 @@ Color tint // Text font info functions /// Measure string width for default font - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int MeasureText(sbyte* text, int fontSize); /// Measure string size for Font - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 MeasureTextEx(Font font, sbyte* text, float fontSize, float spacing); /// /// Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetGlyphIndex(Font font, int character); /// /// Get glyph font info data for a codepoint (unicode character), fallback to '?' if not found /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern GlyphInfo GetGlyphInfo(Font font, int codepoint); /// /// Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to '?' if not found /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Rectangle GetGlyphAtlasRec(Font font, int codepoint); // Text codepoints management functions (unicode characters) /// Load UTF-8 text encoded from codepoints array - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* LoadUTF8(int* codepoints, int length); /// Unload UTF-8 text encoded from codepoints array - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadUTF8(sbyte* text); /// Load all codepoints from a UTF-8 text string, codepoints count returned by parameter - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int* LoadCodepoints(sbyte* text, int* count); /// Unload codepoints data from memory - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadCodepoints(int* codepoints); /// Get total number of codepoints in a UTF8 encoded string - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetCodepointCount(sbyte* text); /// Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetCodepoint(sbyte* text, int* codepointSize); /// Get next codepoint in a UTF-8 encoded string; 0x3f('?') is returned on failure - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetCodepointNext(sbyte* text, int* codepointSize); /// Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetCodepointPrevious(sbyte* text, int* codepointSize); /// Encode one codepoint into UTF-8 byte array (array length returned as parameter) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* CodepointToUTF8(int codepoint, int* utf8Size); @@ -1927,63 +1927,63 @@ Color tint // NOTE: Some strings allocate memory internally for returned strings, just be careful! // Copy one string to another, returns bytes copied - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TextCopy(sbyte* dst, sbyte* src); /// Check if two text string are equal - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool TextIsEqual(sbyte* text1, sbyte* text2); /// Get text length, checks for '\0' ending - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint TextLength(sbyte* text); /// Text formatting with variables (sprintf style) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* TextFormat(sbyte* text); /// Get a piece of a text string - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* TextSubtext(sbyte* text, int position, int length); /// Replace text string (WARNING: memory must be freed!) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* TextReplace(sbyte* text, sbyte* replace, sbyte* by); /// Insert text in a position (WARNING: memory must be freed!) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* TextInsert(sbyte* text, sbyte* insert, int position); /// Join text strings with delimiter - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* TextJoin(sbyte** textList, int count, sbyte* delimiter); /// Split text into multiple strings - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte** TextSplit(sbyte* text, char delimiter, int* count); /// Append text at specific position and move cursor! - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TextAppend(sbyte* text, sbyte* append, int* position); /// Find first text occurrence within a string - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TextFindIndex(sbyte* text, sbyte* find); /// Get upper case version of provided string - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* TextToUpper(sbyte* text); /// Get lower case version of provided string - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* TextToLower(sbyte* text); /// Get Pascal case notation version of provided string - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern sbyte* TextToPascal(sbyte* text); /// Get integer value from text (negative values not supported) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TextToInteger(sbyte* text); @@ -1994,15 +1994,15 @@ Color tint // Basic geometric 3D shapes drawing functions /// Draw a line in 3D world space - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); /// Draw a point in 3D space, actually a small line - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawPoint3D(Vector3 position, Color color); /// Draw a circle in 3D world space - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCircle3D( Vector3 center, float radius, @@ -2012,43 +2012,43 @@ Color color ); /// Draw a color-filled triangle (vertex in counter-clockwise order!) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); /// Draw a triangle strip defined by points - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawTriangleStrip3D(Vector3* points, int pointCount, Color color); /// Draw cube - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCube(Vector3 position, float width, float height, float length, Color color); /// Draw cube (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCubeV(Vector3 position, Vector3 size, Color color); /// Draw cube wires - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); /// Draw cube wires (Vector version) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); /// Draw sphere - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawSphere(Vector3 centerPos, float radius, Color color); /// Draw sphere with extended parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); /// Draw sphere wires - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); /// Draw a cylinder/cone - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCylinder( Vector3 position, float radiusTop, @@ -2059,7 +2059,7 @@ Color color ); /// Draw a cylinder with base at startPos and top at endPos - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCylinderEx( Vector3 startPos, Vector3 endPos, @@ -2070,7 +2070,7 @@ Color color ); /// Draw a cylinder/cone wires - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCylinderWires( Vector3 position, float radiusTop, @@ -2081,7 +2081,7 @@ Color color ); /// Draw a cylinder wires with base at startPos and top at endPos - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCylinderWiresEx( Vector3 startPos, Vector3 endPos, @@ -2092,7 +2092,7 @@ Color color ); /// Draw a capsule with the center of its sphere caps at startPos and endPos - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCapsule( Vector3 startPos, Vector3 endPos, @@ -2103,7 +2103,7 @@ Color color ); /// Draw capsule wireframe with the center of its sphere caps at startPos and endPos - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawCapsuleWires( Vector3 startPos, Vector3 endPos, @@ -2114,15 +2114,15 @@ Color color ); /// Draw a plane XZ - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawPlane(Vector3 centerPos, Vector2 size, Color color); /// Draw a ray line - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawRay(Ray ray, Color color); /// Draw a grid (centered at (0, 0, 0)) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawGrid(int slices, float spacing); @@ -2133,34 +2133,34 @@ Color color // Model management functions /// Load model from files (meshes and materials) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Model LoadModel(sbyte* fileName); /// Load model from generated mesh (default material) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Model LoadModelFromMesh(Mesh mesh); /// Check if a model is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsModelReady(Model model); /// Unload model from memory (RAM and/or VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadModel(Model model); /// Compute model bounding box limits (considers all meshes) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern BoundingBox GetModelBoundingBox(Model model); // Model drawing functions /// Draw a model (with texture if set) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawModel(Model model, Vector3 position, float scale, Color tint); /// Draw a model with extended parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawModelEx( Model model, Vector3 position, @@ -2171,11 +2171,11 @@ Color tint ); /// Draw a model wires (with texture if set) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawModelWires(Model model, Vector3 position, float scale, Color tint); /// Draw a model wires (with texture if set) with extended parameters - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawModelWiresEx( Model model, Vector3 position, @@ -2186,11 +2186,11 @@ Color tint ); /// Draw bounding box (wires) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawBoundingBox(BoundingBox box, Color color); /// Draw a billboard texture - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawBillboard( Camera3D camera, Texture2D texture, @@ -2200,7 +2200,7 @@ Color tint ); /// Draw a billboard texture defined by source - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawBillboardRec( Camera3D camera, Texture2D texture, @@ -2211,7 +2211,7 @@ Color tint ); /// Draw a billboard texture defined by source and rotation - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawBillboardPro( Camera3D camera, Texture2D texture, @@ -2228,82 +2228,82 @@ Color tint // Mesh management functions /// Upload vertex data into GPU and provided VAO/VBO ids - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UploadMesh(Mesh* mesh, CBool dynamic); /// Update mesh vertex data in GPU for a specific buffer index - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateMeshBuffer(Mesh mesh, int index, void* data, int dataSize, int offset); /// Unload mesh from memory (RAM and/or VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadMesh(Mesh* mesh); /// Draw a 3d mesh with material and transform - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawMesh(Mesh mesh, Material material, Matrix4x4 transform); /// Draw multiple mesh instances with material and different transforms - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DrawMeshInstanced(Mesh mesh, Material material, Matrix4x4* transforms, int instances); /// Export mesh data to file, returns true on success - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ExportMesh(Mesh mesh, sbyte* fileName); /// Compute mesh bounding box limits - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern BoundingBox GetMeshBoundingBox(Mesh mesh); /// Compute mesh tangents - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void GenMeshTangents(Mesh* mesh); // Mesh generation functions /// Generate polygonal mesh - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshPoly(int sides, float radius); /// Generate plane mesh (with subdivisions) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshPlane(float width, float length, int resX, int resZ); /// Generate cuboid mesh - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshCube(float width, float height, float length); /// Generate sphere mesh (standard sphere) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshSphere(float radius, int rings, int slices); /// Generate half-sphere mesh (no bottom cap) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshHemiSphere(float radius, int rings, int slices); /// Generate cylinder mesh - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshCylinder(float radius, float height, int slices); /// Generate cone/pyramid mesh - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshCone(float radius, float height, int slices); /// Generate torus mesh - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); /// Generate trefoil knot mesh - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); /// Generate heightmap mesh from image data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshHeightmap(Image heightmap, Vector3 size); /// Generate cubes-based map mesh from image data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); @@ -2311,56 +2311,56 @@ Color tint //TODO: safe Helper method /// Load materials from model file - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Material* LoadMaterials(sbyte* fileName, int* materialCount); /// Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Material LoadMaterialDefault(); /// Check if a material is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsMaterialReady(); /// Unload material from GPU memory (VRAM) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadMaterial(Material material); /// Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMaterialTexture(Material* material, MaterialMapIndex mapType, Texture2D texture); /// Set material for a mesh - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetModelMeshMaterial(Model* model, int meshId, int materialId); // Model animations loading/unloading functions /// Load model animations from file - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern ModelAnimation* LoadModelAnimations(sbyte* fileName, uint* animCount); /// Update model animation pose - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); /// Unload animation data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadModelAnimation(ModelAnimation anim); /// Unload animation array data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadModelAnimations(ModelAnimation* animations, uint count); /// Check model animation skeleton match - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsModelAnimationValid(Model model, ModelAnimation anim); // Collision detection functions /// Detect collision between two spheres - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionSpheres( Vector3 center1, float radius1, @@ -2369,31 +2369,31 @@ float radius2 ); /// Detect collision between two bounding boxes - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); /// Detect collision between box and sphere - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); /// Detect collision between ray and sphere - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern RayCollision GetRayCollisionSphere(Ray ray, Vector3 center, float radius); /// Detect collision between ray and box - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern RayCollision GetRayCollisionBox(Ray ray, BoundingBox box); /// Get collision info between ray and mesh - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern RayCollision GetRayCollisionMesh(Ray ray, Mesh mesh, Matrix4x4 transform); /// Get collision info between ray and triangle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern RayCollision GetRayCollisionTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); /// Get collision info between ray and quad - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); @@ -2404,281 +2404,281 @@ float radius2 // Audio device management functions /// Initialize audio device and context - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void InitAudioDevice(); /// Close the audio device and context - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void CloseAudioDevice(); /// Check if audio device has been initialized successfully - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsAudioDeviceReady(); /// Set master volume (listener) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMasterVolume(float volume); // Wave/Sound loading/unloading functions /// Load wave data from file - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Wave LoadWave(sbyte* fileName); /// Load wave from memory buffer, fileType refers to extension: i.e. "wav" - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Wave LoadWaveFromMemory(sbyte* fileType, byte* fileData, int dataSize); /// Checks if wave data is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsWaveReady(Wave wave); /// Load sound from file - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Sound LoadSound(sbyte* fileName); /// Load sound from wave data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Sound LoadSoundFromWave(Wave wave); /// Checks if a sound is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsSoundReady(Sound sound); /// Update sound buffer with new data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateSound(Sound sound, void* data, int sampleCount); /// Unload wave data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadWave(Wave wave); /// Unload sound - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadSound(Sound sound); /// Export wave data to file - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ExportWave(Wave wave, sbyte* fileName); /// Export wave sample data to code (.h) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool ExportWaveAsCode(Wave wave, sbyte* fileName); // Wave/Sound management functions /// Play a sound - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void PlaySound(Sound sound); /// Stop playing a sound - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void StopSound(Sound sound); /// Pause a sound - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void PauseSound(Sound sound); /// Resume a paused sound - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ResumeSound(Sound sound); /// Get number of sounds playing in the multichannel - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int GetSoundsPlaying(); /// Check if a sound is currently playing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsSoundPlaying(Sound sound); /// Set volume for a sound (1.0 is max level) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetSoundVolume(Sound sound, float volume); /// Set pitch for a sound (1.0 is base level) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetSoundPitch(Sound sound, float pitch); /// Set pan for a sound (0.5 is center) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetSoundPan(Sound sound, float pan); /// Copy a wave to a new wave - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Wave WaveCopy(Wave wave); /// Crop a wave to defined samples range - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void WaveCrop(Wave* wave, int initSample, int finalSample); /// Convert wave data to desired format - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void WaveFormat(Wave* wave, int sampleRate, int sampleSize, int channels); /// Get samples data from wave as a floats array - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float* LoadWaveSamples(Wave wave); /// Unload samples data loaded with LoadWaveSamples() - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadWaveSamples(float* samples); // Music management functions /// Load music stream from file - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Music LoadMusicStream(sbyte* fileName); /// Load music stream from memory buffer, fileType refers to extension: i.e. ".wav" - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Music LoadMusicStreamFromMemory(sbyte* fileType, byte* data, int dataSize); /// Checks if a music stream is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsMusicReady(Music music); /// Unload music stream - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadMusicStream(Music music); /// Start music playing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void PlayMusicStream(Music music); /// Check if music is playing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsMusicStreamPlaying(Music music); /// Updates buffers for music streaming - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateMusicStream(Music music); /// Stop music playing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void StopMusicStream(Music music); /// Pause music playing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void PauseMusicStream(Music music); /// Resume playing paused music - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ResumeMusicStream(Music music); /// Seek music to a position (in seconds) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SeekMusicStream(Music music, float position); /// Set volume for music (1.0 is max level) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMusicVolume(Music music, float volume); /// Set pitch for a music (1.0 is base level) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMusicPitch(Music music, float pitch); /// Set pan for a music (0.5 is center) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetMusicPan(Music music, float pan); /// Get music time length (in seconds) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float GetMusicTimeLength(Music music); /// Get current music time played (in seconds) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float GetMusicTimePlayed(Music music); // AudioStream management functions /// Init audio stream (to stream raw audio pcm data) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern AudioStream LoadAudioStream(uint sampleRate, uint sampleSize, uint channels); /// Checks if an audio stream is ready - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsAudioStreamReady(AudioStream stream); /// Unload audio stream and free memory - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UnloadAudioStream(AudioStream stream); /// Update audio stream buffers with data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void UpdateAudioStream(AudioStream stream, void* data, int frameCount); /// Check if any audio stream buffers requires refill - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsAudioStreamProcessed(AudioStream stream); /// Play audio stream - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void PlayAudioStream(AudioStream stream); /// Pause audio stream - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void PauseAudioStream(AudioStream stream); /// Resume audio stream - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void ResumeAudioStream(AudioStream stream); /// Check if audio stream is playing - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern CBool IsAudioStreamPlaying(AudioStream stream); /// Stop audio stream - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void StopAudioStream(AudioStream stream); /// Set volume for audio stream (1.0 is max level) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetAudioStreamVolume(AudioStream stream, float volume); /// Set pitch for audio stream (1.0 is base level) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetAudioStreamPitch(AudioStream stream, float pitch); /// Set pan for audio stream (0.5 is centered) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetAudioStreamPan(AudioStream stream, float pan); /// Default size for new audio streams - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetAudioStreamBufferSizeDefault(int size); /// Audio thread callback to request new data - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SetAudioStreamCallback( AudioStream stream, delegate* unmanaged[Cdecl] callback ); /// Attach audio stream processor to stream - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void AttachAudioStreamProcessor( AudioStream stream, delegate* unmanaged[Cdecl] processor ); /// Detach audio stream processor from stream - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DetachAudioStreamProcessor( AudioStream stream, delegate* unmanaged[Cdecl] processor ); /// Attach audio stream processor to the entire audio pipeline - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void AttachAudioMixedProcessor( delegate* unmanaged[Cdecl] processor ); /// Detach audio stream processor from the entire audio pipeline - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void DetachAudioMixedProcessor( delegate* unmanaged[Cdecl] processor ); diff --git a/Raylib-cs/interop/Raymath.cs b/Raylib-cs/interop/Raymath.cs index 85e0609b..74171bb4 100644 --- a/Raylib-cs/interop/Raymath.cs +++ b/Raylib-cs/interop/Raymath.cs @@ -5,12 +5,12 @@ namespace Raylib_cs { // 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 unsafe struct float16 + public unsafe struct Float16 { public fixed float v[16]; } @@ -21,22 +21,22 @@ public static unsafe partial class Raymath /// /// Used by DllImport to load the native library /// - public const string nativeLibName = "raylib"; + public const string NativeLibName = "raylib"; /// Clamp float value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Clamp(float value, float min, float max); /// Calculate linear interpolation between two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Lerp(float start, float end, float amount); /// Normalize input value within input range - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Normalize(float value, float start, float end); /// Remap input value within input range to output range - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Remap( float value, float inputStart, @@ -46,62 +46,62 @@ float outputEnd ); /// Wrap input value from min to max - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Wrap(float value, float min, float max); /// Check whether two given floats are almost equal - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int FloatEquals(float x, float y); /// Vector with components value 0.0f - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Zero(); /// Vector with components value 1.0f - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2One(); /// Add two vectors (v1 + v2) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2); /// Add vector and float value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2AddValue(Vector2 v, float add); /// Subtract two vectors (v1 - v2) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2); /// Subtract vector by float value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2SubtractValue(Vector2 v, float sub); /// Calculate vector length - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector2Length(Vector2 v); /// Calculate vector square length - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector2LengthSqr(Vector2 v); /// Calculate two vectors dot product - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2); /// Calculate distance between two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector2Distance(Vector2 v1, Vector2 v2); /// Calculate square distance between two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector2DistanceSqr(Vector2 v1, Vector2 v2); /// /// Calculate angle between two vectors /// NOTE: Angle is calculated from origin point (0, 0) /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector2Angle(Vector2 v1, Vector2 v2); /// @@ -109,142 +109,142 @@ float outputEnd /// NOTE: Parameters need to be normalized /// Current implementation should be aligned with glm::angle /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector2LineAngle(Vector2 start, Vector2 end); /// Scale vector (multiply by value) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Scale(Vector2 v, float scale); /// Multiply vector by vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Multiply(Vector2 v1, Vector2 v2); /// Negate vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Negate(Vector2 v); /// Divide vector by vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Divide(Vector2 v1, Vector2 v2); /// Normalize provided vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Normalize(Vector2 v); /// Transforms a Vector2 by a given Matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Transform(Vector2 v, Matrix4x4 mat); /// Calculate linear interpolation between two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount); /// Calculate reflected vector to normal - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Reflect(Vector2 v, Vector2 normal); /// Rotate vector by angle - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Rotate(Vector2 v, float angle); /// Move Vector towards target - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance); /// Invert the given vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Invert(Vector2 v); /// /// Clamp the components of the vector between min and max values specified by the given vectors /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max); /// Clamp the magnitude of the vector between two min and max values - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector2ClampValue(Vector2 v, float min, float max); /// Check whether two given vectors are almost equal - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Vector2Equals(Vector2 p, Vector2 q); /// Vector with components value 0.0f - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Zero(); /// Vector with components value 1.0f - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3One(); /// Add two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2); /// Add vector and float value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3AddValue(Vector3 v, float add); /// Subtract two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2); /// Subtract vector and float value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3SubtractValue(Vector3 v, float sub); /// Multiply vector by scalar - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Scale(Vector3 v, float scalar); /// Multiply vector by vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Multiply(Vector3 v1, Vector3 v2); /// Calculate two vectors cross product - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2); /// Calculate one vector perpendicular vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Perpendicular(Vector3 v); /// Calculate vector length - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector3Length(Vector3 v); /// Calculate vector square length - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector3LengthSqr(Vector3 v); /// Calculate two vectors dot product - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2); /// Calculate distance between two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector3Distance(Vector3 v1, Vector3 v2); /// Calculate square distance between two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float Vector3DistanceSqr(Vector3 v1, Vector3 v2); /// Calculate angle between two vectors in XY and XZ - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector2 Vector3Angle(Vector3 v1, Vector3 v2); /// Negate provided vector (invert direction) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Negate(Vector3 v); /// Divide vector by vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Divide(Vector3 v1, Vector3 v2); /// Normalize provided vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Normalize(Vector3 v); /// @@ -252,72 +252,72 @@ float outputEnd /// Makes vectors normalized and orthogonal to each other
/// Gram-Schmidt function implementation ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Vector3OrthoNormalize(Vector3* v1, Vector3* v2); /// Transforms a Vector3 by a given Matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Transform(Vector3 v, Matrix4x4 mat); /// Transform a vector by quaternion rotation - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q); /// Rotates a vector around an axis - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle); /// Calculate linear interpolation between two vectors - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount); /// Calculate reflected vector to normal - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal); /// Get min value for each pair of components - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2); /// Get max value for each pair of components - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Max(Vector3 v1, Vector3 v2); /// /// Compute barycenter coordinates (u, v, w) for point p with respect to triangle (a, b, c)
/// NOTE: Assumes P is on the plane of the triangle ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c); /// /// Projects a Vector3 from screen space into object space
/// NOTE: We are avoiding calling other raymath functions despite available ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Unproject(Vector3 source, Matrix4x4 projection, Matrix4x4 view); /// Get Vector3 as float array - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern float3 Vector3ToFloatV(Vector3 v); + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern Float3 Vector3ToFloatV(Vector3 v); /// Invert the given vector - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Invert(Vector3 v); /// /// Clamp the components of the vector between /// min and max values specified by the given vectors /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max); /// Clamp the magnitude of the vector between two values - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3ClampValue(Vector3 v, float min, float max); /// Check whether two given vectors are almost equal - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Vector3Equals(Vector3 p, Vector3 q); /// @@ -328,82 +328,82 @@ float outputEnd /// from where the ray comes to the refractive index of the medium /// on the other side of the surface /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 Vector3Refract(Vector3 v, Vector3 n, float r); /// Compute matrix determinant - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float MatrixDeterminant(Matrix4x4 mat); /// Get the trace of the matrix (sum of the values along the diagonal) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float MatrixTrace(Matrix4x4 mat); /// Transposes provided matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixTranspose(Matrix4x4 mat); /// Invert provided matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixInvert(Matrix4x4 mat); /// Get identity matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixIdentity(); /// Add two matrices - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixAdd(Matrix4x4 left, Matrix4x4 right); /// Subtract two matrices (left - right) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixSubtract(Matrix4x4 left, Matrix4x4 right); /// /// Get two matrix multiplication
/// NOTE: When multiplying matrices... the order matters! ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixMultiply(Matrix4x4 left, Matrix4x4 right); /// Get translation matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixTranslate(float x, float y, float z); /// /// Create rotation matrix from axis and angle
/// NOTE: Angle should be provided in radians ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixRotate(Vector3 axis, float angle); /// Get x-rotation matrix (angle in radians) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixRotateX(float angle); /// Get y-rotation matrix (angle in radians) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixRotateY(float angle); /// Get z-rotation matrix (angle in radians) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixRotateZ(float angle); /// Get xyz-rotation matrix (angles in radians) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixRotateXYZ(Vector3 ang); /// Get zyx-rotation matrix (angles in radians) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixRotateZYX(Vector3 ang); /// Get scaling matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixScale(float x, float y, float z); /// Get perspective projection matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixFrustum( double left, double right, @@ -417,11 +417,11 @@ double far /// Get perspective projection matrix
/// NOTE: Angle should be provided in radians /// - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixPerspective(double fovy, double aspect, double near, double far); /// Get orthographic projection matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixOrtho( double left, double right, @@ -432,113 +432,113 @@ double far ); /// Get camera look-at matrix (view matrix) - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up); /// Get float array of matrix data - [DllImport(Raylib.nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern float16 MatrixToFloatV(Matrix4x4 m); + [DllImport(Raylib.NativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern Float16 MatrixToFloatV(Matrix4x4 m); /// Add 2 quaternions - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionAdd(Quaternion q1, Quaternion q2); /// Add quaternion and float value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionAddValue(Quaternion q, float add); /// Subtract 2 quaternions - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2); /// Subtract quaternion and float value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionSubtractValue(Quaternion q, float add); /// Get identity quaternion - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionIdentity(); /// Computes the length of a quaternion - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern float QuaternionLength(Quaternion q); /// Normalize provided quaternion - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionNormalize(Quaternion q); /// Invert provided quaternion - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionInvert(Quaternion q); /// Calculate two quaternion multiplication - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2); /// Scale quaternion by float value - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionScale(Quaternion q, float mul); /// Divide two quaternions - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionDivide(Quaternion q1, Quaternion q2); /// Calculate linear interpolation between two quaternions - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount); /// Calculate slerp-optimized interpolation between two quaternions - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount); /// Calculates spherical linear interpolation between two quaternions - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount); /// Calculate quaternion based on the rotation from one vector to another - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to); /// Get a quaternion for a given rotation matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionFromMatrix(Matrix4x4 mat); /// Get a matrix for a given quaternion - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Matrix4x4 QuaternionToMatrix(Quaternion q); /// /// Get rotation quaternion for an angle and axis
/// NOTE: angle must be provided in radians ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle); /// Get the rotation angle and axis for a given quaternion - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void QuaternionToAxisAngle(Quaternion q, Vector3* outAxis, float* outAngle); /// /// Get the quaternion equivalent to Euler angles
/// NOTE: Rotation order is ZYX ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionFromEuler(float pitch, float yaw, float roll); /// /// Get the Euler angles equivalent to quaternion (roll, pitch, yaw)
/// NOTE: Angles are returned in a Vector3 struct in radians ///
- [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Vector3 QuaternionToEuler(Quaternion q); /// Transform a quaternion given a transformation matrix - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Quaternion QuaternionTransform(Quaternion q, Matrix4x4 mat); /// Check whether two given quaternions are almost equal - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int QuaternionEquals(Quaternion p, Quaternion q); } } diff --git a/Raylib-cs/interop/Rlgl.cs b/Raylib-cs/interop/Rlgl.cs index 42038339..b71ad16d 100644 --- a/Raylib-cs/interop/Rlgl.cs +++ b/Raylib-cs/interop/Rlgl.cs @@ -10,137 +10,137 @@ public static unsafe partial class Rlgl /// /// Used by DllImport to load the native library /// - public const string nativeLibName = "raylib"; + public const string NativeLibName = "raylib"; public const int DEFAULT_BATCH_BUFFER_ELEMENTS = 8192; public const int DEFAULT_BATCH_BUFFERS = 1; 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 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 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_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 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 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); + Float16 f = Raymath.MatrixToFloatV(matf); + 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 @@ public static extern void rlFrustum( 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 @@ double zfar ); /// 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 @@ double zfar // ------------------------------------------------------------------------------------ /// 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 @@ public static void rlBegin(DrawMode mode) /// 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 @@ int glEqAlpha // ------------------------------------------------------------------------------------ /// 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 @@ public static extern void rlSetVertexAttribute( 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 @@ int instances // 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 @@ public static extern void rlUpdateTexture( ); /// 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 @@ public static extern void rlGetGlTextureFormats( ); /// 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 @@ int mipLevel ); /// 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,64 +744,64 @@ uint count ); /// 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(); } } diff --git a/Raylib-cs/types/Audio.cs b/Raylib-cs/types/Audio.cs index 97269599..8a58ccca 100644 --- a/Raylib-cs/types/Audio.cs +++ b/Raylib-cs/types/Audio.cs @@ -12,28 +12,28 @@ public unsafe partial struct Wave /// /// Number of samples /// - public uint sampleCount; + public uint SampleCount; /// /// Frequency (samples per second) /// - public uint sampleRate; + public uint SampleRate; /// /// Bit depth (bits per sample): 8, 16, 32 (24 not supported) /// - public uint sampleSize; + public uint SampleSize; /// /// Number of channels (1-mono, 2-stereo) /// - public uint channels; + public uint Channels; //TODO: SPAN ? /// /// Buffer data pointer /// - public void* data; + public void* Data; } /// @@ -47,27 +47,27 @@ public partial struct AudioStream /// /// Pointer to internal data(rAudioBuffer *) used by the audio system /// - public IntPtr buffer; + public IntPtr Buffer; /// /// Pointer to internal data processor, useful for audio effects /// - public IntPtr processor; + public IntPtr Processor; /// /// Frequency (samples per second) /// - public uint sampleRate; + public uint SampleRate; /// /// Bit depth (bits per sample): 8, 16, 32 (24 not supported) /// - public uint sampleSize; + public uint SampleSize; /// /// Number of channels (1-mono, 2-stereo) /// - public uint channels; + public uint Channels; } /// @@ -79,12 +79,12 @@ public partial struct Sound /// /// Audio stream /// - public AudioStream stream; + public AudioStream Stream; /// /// Total number of frames (considering channels) /// - public uint frameCount; + public uint FrameCount; } /// @@ -97,27 +97,27 @@ public unsafe partial struct Music /// /// Audio stream /// - public AudioStream stream; + public AudioStream Stream; /// /// Total number of samples /// - public uint frameCount; + public uint FrameCount; /// /// Music looping enable /// - public CBool looping; + public CBool Looping; /// /// Type of music context (audio filetype) /// - public int ctxType; + public int CtxType; //TODO span /// /// Audio context data, depends on type /// - public void* ctxData; + public void* CtxData; } } diff --git a/Raylib-cs/types/BoundingBox.cs b/Raylib-cs/types/BoundingBox.cs index 0bea2a75..77d16ce2 100644 --- a/Raylib-cs/types/BoundingBox.cs +++ b/Raylib-cs/types/BoundingBox.cs @@ -10,17 +10,17 @@ public partial struct BoundingBox /// /// Minimum vertex box-corner /// - public Vector3 min; + public Vector3 Min; /// /// Maximum vertex box-corner /// - public Vector3 max; + public Vector3 Max; public BoundingBox(Vector3 min, Vector3 max) { - this.min = min; - this.max = max; + this.Min = min; + this.Max = max; } } } diff --git a/Raylib-cs/types/Camera2D.cs b/Raylib-cs/types/Camera2D.cs index 76ad5bde..72fc72a4 100644 --- a/Raylib-cs/types/Camera2D.cs +++ b/Raylib-cs/types/Camera2D.cs @@ -12,29 +12,29 @@ public partial struct Camera2D /// /// Camera offset (displacement from target) /// - public Vector2 offset; + public Vector2 Offset; /// /// Camera target (rotation and zoom origin) /// - public Vector2 target; + public Vector2 Target; /// /// Camera rotation in degrees /// - public float rotation; + public float Rotation; /// /// Camera zoom (scaling), should be 1.0f by default /// - public float zoom; + public float Zoom; public Camera2D(Vector2 offset, Vector2 target, float rotation, float zoom) { - this.offset = offset; - this.target = target; - this.rotation = rotation; - this.zoom = zoom; + this.Offset = offset; + this.Target = target; + this.Rotation = rotation; + this.Zoom = zoom; } } } diff --git a/Raylib-cs/types/Camera3D.cs b/Raylib-cs/types/Camera3D.cs index e4b5299b..c66fea24 100644 --- a/Raylib-cs/types/Camera3D.cs +++ b/Raylib-cs/types/Camera3D.cs @@ -33,35 +33,35 @@ public partial struct Camera3D /// /// Camera position /// - public Vector3 position; + public Vector3 Position; /// /// Camera target it looks-at /// - public Vector3 target; + public Vector3 Target; /// /// Camera up vector (rotation over its axis) /// - public Vector3 up; + public Vector3 Up; /// /// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic /// - public float fovy; + public float FovY; /// /// Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC /// - 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.target = target; - this.up = up; - this.fovy = fovy; - this.projection = projection; + this.Position = position; + this.Target = target; + this.Up = up; + this.FovY = fovY; + this.Projection = projection; } } } diff --git a/Raylib-cs/types/Color.cs b/Raylib-cs/types/Color.cs index b2ccb2cd..4fb7478d 100644 --- a/Raylib-cs/types/Color.cs +++ b/Raylib-cs/types/Color.cs @@ -9,10 +9,10 @@ namespace Raylib_cs [StructLayout(LayoutKind.Sequential)] public partial struct Color { - public byte r; - public byte g; - public byte b; - public byte a; + public byte R; + public byte G; + public byte B; + public byte A; // Example - Color.RED instead of RED // Custom raylib color palette for amazing visuals @@ -45,23 +45,23 @@ public partial struct Color public Color(byte r, byte g, byte b, byte a) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; + this.R = r; + this.G = g; + this.B = b; + this.A = a; } public Color(int r, int g, int b, int a) { - this.r = Convert.ToByte(r); - this.g = Convert.ToByte(g); - this.b = Convert.ToByte(b); - this.a = Convert.ToByte(a); + this.R = Convert.ToByte(r); + this.G = Convert.ToByte(g); + this.B = Convert.ToByte(b); + this.A = Convert.ToByte(a); } public override string ToString() { - return $"{{R:{r} G:{g} B:{b} A:{a}}}"; + return $"{{R:{R} G:{G} B:{B} A:{A}}}"; } } } diff --git a/Raylib-cs/types/Font.cs b/Raylib-cs/types/Font.cs index 8bf95f35..1e508da7 100644 --- a/Raylib-cs/types/Font.cs +++ b/Raylib-cs/types/Font.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Raylib_cs @@ -33,27 +32,27 @@ public partial struct GlyphInfo /// /// Character value (Unicode) /// - public int value; + public int Value; /// /// Character offset X when drawing /// - public int offsetX; + public int OffsetX; /// /// Character offset Y when drawing /// - public int offsetY; + public int OffsetY; /// /// Character advance position X /// - public int advanceX; + public int AdvanceX; /// /// Character image data /// - public Image image; + public Image Image; } /// @@ -65,31 +64,31 @@ public unsafe partial struct Font /// /// Base size (default chars height) /// - public int baseSize; + public int BaseSize; /// /// Number of characters /// - public int glyphCount; + public int GlyphCount; /// /// Padding around the glyph characters /// - public int glyphPadding; + public int GlyphPadding; /// /// Texture atlas containing the glyphs /// - public Texture2D texture; + public Texture2D Texture; /// /// Rectangles in texture for the glyphs /// - public Rectangle* recs; + public Rectangle* Recs; /// /// Glyphs info data /// - public GlyphInfo* glyphs; + public GlyphInfo* Glyphs; } } diff --git a/Raylib-cs/types/Image.cs b/Raylib-cs/types/Image.cs index 3480fc59..98a18fa1 100644 --- a/Raylib-cs/types/Image.cs +++ b/Raylib-cs/types/Image.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Raylib_cs @@ -124,26 +123,26 @@ public unsafe partial struct Image /// /// Image raw data /// - public void* data; + public void* Data; /// /// Image base width /// - public int width; + public int Width; /// /// Image base height /// - public int height; + public int Height; /// /// Mipmap levels, 1 by default /// - public int mipmaps; + public int Mipmaps; /// /// Data format (PixelFormat type) /// - public PixelFormat format; + public PixelFormat Format; } } diff --git a/Raylib-cs/types/Input.cs b/Raylib-cs/types/Input.cs index c5d254ff..cf567304 100644 --- a/Raylib-cs/types/Input.cs +++ b/Raylib-cs/types/Input.cs @@ -398,52 +398,52 @@ public unsafe partial struct VrDeviceInfo /// /// HMD horizontal resolution in pixels /// - public int hResolution; + public int HResolution; /// /// HMD vertical resolution in pixels /// - public int vResolution; + public int VResolution; /// /// HMD horizontal size in meters /// - public float hScreenSize; + public float HScreenSize; /// /// HMD vertical size in meters /// - public float vScreenSize; + public float VScreenSize; /// /// HMD screen center in meters /// - public float vScreenCenter; + public float VScreenCenter; /// /// HMD distance between eye and display in meters /// - public float eyeToScreenDistance; + public float EyeToScreenDistance; /// /// HMD lens separation distance in meters /// - public float lensSeparationDistance; + public float LensSeparationDistance; /// /// HMD IPD (distance between pupils) in meters /// - public float interpupillaryDistance; + public float InterpupillaryDistance; /// /// HMD lens distortion constant parameters /// - public fixed float lensDistortionValues[4]; + public fixed float LensDistortionValues[4]; /// /// HMD chromatic aberration correction parameters /// - public fixed float chromaAbCorrection[4]; + public fixed float ChromaAbCorrection[4]; } /// @@ -455,51 +455,51 @@ public partial struct VrStereoConfig /// /// VR projection matrices (per eye) /// - public Matrix4x4 projection1; + public Matrix4x4 Projection1; /// /// VR projection matrices (per eye) /// - public Matrix4x4 projection2; + public Matrix4x4 Projection2; /// /// VR view offset matrices (per eye) /// - public Matrix4x4 viewOffset1; + public Matrix4x4 ViewOffset1; /// /// VR view offset matrices (per eye) /// - public Matrix4x4 viewOffset2; + public Matrix4x4 ViewOffset2; /// /// VR left lens center /// - public Vector2 leftLensCenter; + public Vector2 LeftLensCenter; /// /// VR right lens center /// - public Vector2 rightLensCenter; + public Vector2 RightLensCenter; /// /// VR left screen center /// - public Vector2 leftScreenCenter; + public Vector2 LeftScreenCenter; /// /// VR right screen center /// - public Vector2 rightScreenCenter; + public Vector2 RightScreenCenter; /// /// VR distortion scale /// - public Vector2 scale; + public Vector2 Scale; /// /// VR distortion scale in /// - public Vector2 scaleIn; + public Vector2 ScaleIn; } } diff --git a/Raylib-cs/types/Logging.cs b/Raylib-cs/types/Logging.cs index d1e97759..a301252a 100644 --- a/Raylib-cs/types/Logging.cs +++ b/Raylib-cs/types/Logging.cs @@ -13,28 +13,28 @@ internal readonly struct Native internal const string LibSystem = "libSystem"; [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)] - 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)] - 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)] - 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)] - 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)] struct VaListLinuxX64 { - uint gpOffset; - uint fpOffset; - IntPtr overflowArgArea; - IntPtr regSaveArea; + uint _gpOffset; + uint _fpOffset; + IntPtr _overflowArgArea; + IntPtr _regSaveArea; } /// @@ -62,14 +62,14 @@ public static string GetLogMessage(IntPtr format, IntPtr 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) { return string.Empty; } var buffer = Marshal.AllocHGlobal(byteLength); - vsprintf(buffer, format, args); + VsPrintf(buffer, format, args); string result = Marshal.PtrToStringUTF8(buffer); Marshal.FreeHGlobal(buffer); @@ -82,7 +82,7 @@ static string AppleLogCallback(IntPtr format, IntPtr args) IntPtr buffer = IntPtr.Zero; try { - var count = Native.vasprintf_apple(ref buffer, format, args); + var count = Native.VasPrintfApple(ref buffer, format, args); if (count == -1) { return string.Empty; @@ -106,7 +106,7 @@ static string LinuxX64LogCallback(IntPtr format, IntPtr args) // Get length of args listPointer = Marshal.AllocHGlobal(Marshal.SizeOf(listStructure)); 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 Marshal.StructureToPtr(listStructure, listPointer, false); @@ -115,7 +115,7 @@ static string LinuxX64LogCallback(IntPtr format, IntPtr args) utf8Buffer = Marshal.AllocHGlobal(byteLength); // Print result into buffer - Native.vsprintf_linux(utf8Buffer, format, listPointer); + Native.VsPrintfLinux(utf8Buffer, format, listPointer); result = Marshal.PtrToStringUTF8(utf8Buffer); Marshal.FreeHGlobal(listPointer); @@ -125,38 +125,38 @@ static string LinuxX64LogCallback(IntPtr format, IntPtr args) } // 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; 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)) { - return Native.vsnprintf_linux(buffer, size, format, args); + return Native.VsnPrintfLinux(buffer, size, format, args); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID"))) { - return Native.vsprintf_linux(buffer, format, args); + return Native.VsPrintfLinux(buffer, format, args); } return -1; } - // yhttps://github.com/dotnet/runtime/issues/51052 - static int vsprintf(IntPtr buffer, IntPtr format, IntPtr args) + // https://github.com/dotnet/runtime/issues/51052 + static int VsPrintf(IntPtr buffer, IntPtr format, IntPtr args) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - return Native.vsprintf_windows(buffer, format, args); + return Native.VsPrintfWindows(buffer, format, args); } 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"))) { - return Native.vsprintf_linux(buffer, format, args); + return Native.VsPrintfLinux(buffer, format, args); } return -1; } diff --git a/Raylib-cs/types/Material.cs b/Raylib-cs/types/Material.cs index fcb4f4d4..d5b3d220 100644 --- a/Raylib-cs/types/Material.cs +++ b/Raylib-cs/types/Material.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Raylib_cs @@ -54,17 +53,17 @@ public partial struct MaterialMap /// /// Material map texture /// - public Texture2D texture; + public Texture2D Texture; /// /// Material map color /// - public Color color; + public Color Color; /// /// Material map value /// - public float value; + public float Value; } /// @@ -76,17 +75,17 @@ public unsafe partial struct Material /// /// Material shader /// - public Shader shader; + public Shader Shader; //TODO: convert /// /// Material maps /// - public MaterialMap* maps; + public MaterialMap* Maps; /// /// Material generic parameters (if required) /// - public fixed float param[4]; + public fixed float Param[4]; } } diff --git a/Raylib-cs/types/Mesh.cs b/Raylib-cs/types/Mesh.cs index 1f4562df..61926f2b 100644 --- a/Raylib-cs/types/Mesh.cs +++ b/Raylib-cs/types/Mesh.cs @@ -1,5 +1,3 @@ -using System; -using System.Numerics; using System.Runtime.InteropServices; namespace Raylib_cs @@ -14,49 +12,49 @@ public unsafe partial struct Mesh /// /// Number of vertices stored in arrays /// - public int vertexCount; + public int VertexCount; /// /// Number of triangles stored (indexed or not) /// - public int triangleCount; + public int TriangleCount; #region Default vertex data /// /// Vertex position (XYZ - 3 components per vertex) (shader-location = 0) /// - public float* vertices; + public float* Vertices; /// /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) /// - public float* texcoords; + public float* TexCoords; /// /// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) /// - public float* texcoords2; + public float* TexCoords2; /// /// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) /// - public float* normals; + public float* Normals; /// /// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) /// - public float* tangents; + public float* Tangents; /// /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// - public byte* colors; + public byte* Colors; /// /// Vertex indices (in case vertex data comes indexed) /// - public ushort* indices; + public ushort* Indices; #endregion @@ -65,22 +63,22 @@ public unsafe partial struct Mesh /// /// Animated vertex positions (after bones transformations) /// - public float* animVertices; + public float* AnimVertices; /// /// Animated normals (after bones transformations) /// - public float* animNormals; + public float* AnimNormals; /// /// Vertex bone ids, up to 4 bones influence by vertex (skinning) /// - public byte* boneIds; + public byte* BoneIds; /// /// Vertex bone weight, up to 4 bones influence by vertex (skinning) /// - public float* boneWeights; + public float* BoneWeights; #endregion @@ -89,12 +87,12 @@ public unsafe partial struct Mesh /// /// OpenGL Vertex Array Object id /// - public uint vaoId; + public uint VaoId; /// /// OpenGL Vertex Buffer Objects id (default vertex data, uint[]) /// - public uint* vboId; + public uint* VboId; #endregion } diff --git a/Raylib-cs/types/Model.cs b/Raylib-cs/types/Model.cs index 4cd15536..5405d6cb 100644 --- a/Raylib-cs/types/Model.cs +++ b/Raylib-cs/types/Model.cs @@ -13,12 +13,12 @@ public unsafe partial struct BoneInfo /// /// Bone name (char[32]) /// - public fixed sbyte name[32]; + public fixed sbyte Name[32]; /// /// Bone parent /// - public int parent; + public int Parent; } /// @@ -30,49 +30,49 @@ public unsafe partial struct Model /// /// Local transform matrix /// - public Matrix4x4 transform; + public Matrix4x4 Transform; /// /// Number of meshes /// - public int meshCount; + public int MeshCount; /// /// Number of materials /// - public int materialCount; + public int MaterialCount; /// /// Meshes array (Mesh *) /// - public Mesh* meshes; + public Mesh* Meshes; /// /// Materials array (Material *) /// - public Material* materials; + public Material* Materials; /// /// Mesh material number (int *) /// - public int* meshMaterial; + public int* MeshMaterial; /// /// Number of bones /// - public int boneCount; + public int BoneCount; //TODO: Span /// /// Bones information (skeleton, BoneInfo *) /// - public BoneInfo* bones; + public BoneInfo* Bones; //TODO: Span /// /// Bones base transformation (pose, Transform *) /// - public Transform* bindPose; + public Transform* BindPose; } /// @@ -84,68 +84,62 @@ public readonly unsafe partial struct ModelAnimation /// /// Number of bones /// - public readonly int boneCount; + public readonly int BoneCount; /// /// Number of animation frames /// - public readonly int frameCount; + public readonly int FrameCount; /// /// Bones information (skeleton, BoneInfo *) /// - public readonly BoneInfo* bones; + public readonly BoneInfo* Bones; - /// - public ReadOnlySpan BoneInfo => new(bones, boneCount); + /// + public ReadOnlySpan BoneInfo => new(Bones, BoneCount); /// /// Poses array by frame (Transform **) /// - public readonly Transform** framePoses; + public readonly Transform** FramePoses; - /// - public FramePosesCollection FramePoses => new(framePoses, frameCount, boneCount); + /// + public FramePosesCollection FramePosesColl => new(FramePoses, FrameCount, BoneCount); 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) { - this.framePoses = framePoses; - this.frameCount = frameCount; - this.boneCount = boneCount; + this._framePoses = framePoses; + this._frameCount = frameCount; + this._boneCount = boneCount; } } } public unsafe struct FramePoses { - readonly Transform* poses; + readonly Transform* _poses; - readonly int count; + readonly int _count; - public ref Transform this[int index] - { - get - { - return ref poses[index]; - } - } + public ref Transform this[int index] => ref _poses[index]; internal FramePoses(Transform* poses, int count) { - this.poses = poses; - this.count = count; + this._poses = poses; + this._count = count; } } } diff --git a/Raylib-cs/types/NPatchInfo.cs b/Raylib-cs/types/NPatchInfo.cs index 6030f357..77826225 100644 --- a/Raylib-cs/types/NPatchInfo.cs +++ b/Raylib-cs/types/NPatchInfo.cs @@ -32,31 +32,31 @@ public partial struct NPatchInfo /// /// Texture source rectangle /// - public Rectangle source; + public Rectangle Source; /// /// Left border offset /// - public int left; + public int Left; /// /// Top border offset /// - public int top; + public int Top; /// /// Right border offset /// - public int right; + public int Right; /// /// Bottom border offset /// - public int bottom; + public int Bottom; /// /// Layout of the n-patch: 3x3, 1x3 or 3x1 /// - public NPatchLayout layout; + public NPatchLayout Layout; } } diff --git a/Raylib-cs/types/Ray.cs b/Raylib-cs/types/Ray.cs index 0641fff4..60a2e023 100644 --- a/Raylib-cs/types/Ray.cs +++ b/Raylib-cs/types/Ray.cs @@ -12,17 +12,17 @@ public partial struct Ray /// /// Ray position (origin) /// - public Vector3 position; + public Vector3 Position; /// /// Ray direction /// - public Vector3 direction; + public Vector3 Direction; public Ray(Vector3 position, Vector3 direction) { - this.position = position; - this.direction = direction; + this.Position = position; + this.Direction = direction; } } @@ -35,21 +35,21 @@ public partial struct RayCollision /// /// Did the ray hit something? /// - public CBool hit; + public CBool Hit; /// /// Distance to the nearest hit /// - public float distance; + public float Distance; /// /// Point of the nearest hit /// - public Vector3 point; + public Vector3 Point; /// /// Surface normal of hit /// - public Vector3 normal; + public Vector3 Normal; } } diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index fa033ccc..762015d2 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -9,14 +9,14 @@ public static unsafe partial class Raylib /// Initialize window and OpenGL context public static void InitWindow(int width, int height, string title) { - using var str1 = title.ToUTF8Buffer(); + using var str1 = title.ToUtf8Buffer(); InitWindow(width, height, str1.AsPointer()); } /// Set title for window (only PLATFORM_DESKTOP) public static void SetWindowTitle(string title) { - using var str1 = title.ToUTF8Buffer(); + using var str1 = title.ToUtf8Buffer(); SetWindowTitle(str1.AsPointer()); } @@ -35,21 +35,21 @@ public static string GetClipboardText_() /// Set clipboard text content public static void SetClipboardText(string text) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); SetClipboardText(str1.AsPointer()); } /// Open URL with default system browser (if available) public static void OpenURL(string url) { - using var str1 = url.ToUTF8Buffer(); + using var str1 = url.ToUtf8Buffer(); OpenURL(str1.AsPointer()); } /// Set internal gamepad mappings (SDL_GameControllerDB) public static int SetGamepadMappings(string mappings) { - using var str1 = mappings.ToUTF8Buffer(); + using var str1 = mappings.ToUtf8Buffer(); return SetGamepadMappings(str1.AsPointer()); } @@ -64,22 +64,22 @@ public static Shader LoadShader(string vsFileName, string fsFileName) /// Load shader from code string and bind default locations public static Shader LoadShaderFromMemory(string vsCode, string fsCode) { - using var str1 = vsCode.ToUTF8Buffer(); - using var str2 = fsCode.ToUTF8Buffer(); + using var str1 = vsCode.ToUtf8Buffer(); + using var str2 = fsCode.ToUtf8Buffer(); return LoadShaderFromMemory(str1.AsPointer(), str2.AsPointer()); } /// Get shader uniform location public static int GetShaderLocation(Shader shader, string uniformName) { - using var str1 = uniformName.ToUTF8Buffer(); + using var str1 = uniformName.ToUtf8Buffer(); return GetShaderLocation(shader, str1.AsPointer()); } /// Get shader attribute location public static int GetShaderLocationAttrib(Shader shader, string attribName) { - using var str1 = attribName.ToUTF8Buffer(); + using var str1 = attribName.ToUtf8Buffer(); return GetShaderLocationAttrib(shader, str1.AsPointer()); } @@ -159,7 +159,7 @@ public static CBool ExportImageAsCode(Image image, string fileName) /// Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) public static void TraceLog(TraceLogLevel logLevel, string text) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); TraceLog(logLevel, str1.AsPointer()); } @@ -236,11 +236,11 @@ ShaderUniformDataType uniformType public static string[] GetDroppedFiles() { 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); @@ -291,14 +291,14 @@ ref Vector2 collisionPoint /// Create an image from text (default font) public static Image ImageText(string text, int fontSize, Color color) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); return ImageText(str1.AsPointer(), fontSize, color); } /// Create an image from text (custom sprite font) public static Image ImageTextEx(Font font, string text, float fontSize, float spacing, Color tint) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); return ImageTextEx(font, str1.AsPointer(), fontSize, spacing, tint); } @@ -634,7 +634,7 @@ public static void ImageDraw(ref Image dst, Image src, Rectangle srcRec, Rectang /// Draw text (using default font) within an image (destination) public static void ImageDrawText(ref Image dst, string text, int x, int y, int fontSize, Color color) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); fixed (Image* p = &dst) { ImageDrawText(p, str1.AsPointer(), x, y, fontSize, color); @@ -652,7 +652,7 @@ public static void ImageDrawTextEx( Color color ) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); fixed (Image* p = &dst) { ImageDrawTextEx(p, font, str1.AsPointer(), position, fontSize, spacing, color); @@ -862,7 +862,7 @@ public static void DrawTriangleStrip(Vector2[] points, int pointCount, Color col /// Draw text (using default font) public static void DrawText(string text, int posX, int posY, int fontSize, Color color) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); DrawText(str1.AsPointer(), posX, posY, fontSize, color); } @@ -876,7 +876,7 @@ public static void DrawTextEx( Color tint ) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); DrawTextEx(font, str1.AsPointer(), position, fontSize, spacing, tint); } @@ -892,28 +892,28 @@ public static void DrawTextPro( Color tint ) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); DrawTextPro(font, str1.AsPointer(), position, origin, rotation, fontSize, spacing, tint); } /// Measure string width for default font public static int MeasureText(string text, int fontSize) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); return MeasureText(str1.AsPointer(), fontSize); } /// Measure string size for Font public static Vector2 MeasureTextEx(Font font, string text, float fontSize, float spacing) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); return MeasureTextEx(font, str1.AsPointer(), fontSize, spacing); } /// Get all codepoints in a string, codepoints count returned by parameters public static int[] LoadCodepoints(string text, ref int count) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); fixed (int* c = &count) { var pointsPtr = LoadCodepoints(str1.AsPointer(), c); @@ -926,14 +926,14 @@ public static int[] LoadCodepoints(string text, ref int count) /// Get total number of codepoints in a UTF8 encoded string public static int GetCodepointCount(string text) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); return GetCodepointCount(str1.AsPointer()); } /// Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure public static int GetCodepoint(string text, ref int codepointSize) { - using var str1 = text.ToUTF8Buffer(); + using var str1 = text.ToUtf8Buffer(); fixed (int* p = &codepointSize) { return GetCodepoint(str1.AsPointer(), p); @@ -1080,12 +1080,12 @@ public static string SubText(this string input, int position, int length) 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) { - return model.materials[materialIndex].maps[(int)mapIndex].texture; + return model.Materials[materialIndex].Maps[(int)mapIndex].Texture; } public static void SetMaterialTexture( @@ -1095,12 +1095,12 @@ public static void SetMaterialTexture( 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) { - model.materials[materialIndex].shader = shader; + model.Materials[materialIndex].Shader = shader; } } } diff --git a/Raylib-cs/types/Rectangle.cs b/Raylib-cs/types/Rectangle.cs index ef0de9b2..cd21ae93 100644 --- a/Raylib-cs/types/Rectangle.cs +++ b/Raylib-cs/types/Rectangle.cs @@ -8,22 +8,22 @@ namespace Raylib_cs [StructLayout(LayoutKind.Sequential)] public partial struct Rectangle { - public float x; - public float y; - public float width; - public float height; + public float X; + public float Y; + public float Width; + public float Height; public Rectangle(float x, float y, float width, float height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; + this.X = x; + this.Y = y; + this.Width = width; + this.Height = height; } public override string ToString() { - return $"{{X:{x} Y:{y} Width:{width} Height:{height}}}"; + return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}"; } } } diff --git a/Raylib-cs/types/RenderBatch.cs b/Raylib-cs/types/RenderBatch.cs index df86aee6..783bbe69 100644 --- a/Raylib-cs/types/RenderBatch.cs +++ b/Raylib-cs/types/RenderBatch.cs @@ -11,32 +11,32 @@ public unsafe partial struct RenderBatch /// /// Number of vertex buffers (multi-buffering support) /// - int buffersCount; + int _buffersCount; /// /// Current buffer tracking in case of multi-buffering /// - int currentBuffer; + int _currentBuffer; /// /// Dynamic buffer(s) for vertex data /// - VertexBuffer* vertexBuffer; + VertexBuffer* _vertexBuffer; /// /// Draw calls array, depends on textureId /// - DrawCall* draws; + DrawCall* _draws; /// /// Draw calls counter /// - int drawsCounter; + int _drawsCounter; /// /// Current depth value for next draw /// - float currentDepth; + float _currentDepth; } /// @@ -48,39 +48,39 @@ public unsafe partial struct VertexBuffer /// /// Number of elements in the buffer (QUADS) /// - public int elementCount; + public int ElementCount; /// /// Vertex position (XYZ - 3 components per vertex) (shader-location = 0) /// - public float* vertices; + public float* Vertices; /// /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) /// - public float* texcoords; + public float* TexCoords; /// /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// - public byte* colors; + public byte* Colors; /// /// Vertex indices (in case vertex data comes indexed) (6 indices per quad)
/// unsigned int* for GRAPHICS_API_OPENGL_11 or GRAPHICS_API_OPENGL_33
/// unsigned short* for GRAPHICS_API_OPENGL_ES2 ///
- public void* indices; + public void* Indices; /// /// OpenGL Vertex Array Object id /// - public uint vaoId; + public uint VaoId; /// /// OpenGL Vertex Buffer Objects id (4 types of vertex data) /// - public fixed uint vboId[4]; + public fixed uint VboId[4]; } /// @@ -92,22 +92,22 @@ public partial struct DrawCall /// /// Drawing mode: LINES, TRIANGLES, QUADS /// - int mode; + int _mode; /// /// Number of vertices for the draw call /// - int vertexCount; + int _vertexCount; /// /// Number of vertices required for index alignment (LINES, TRIANGLES) /// - int vertexAlignment; + int _vertexAlignment; /// /// Texture id to be used on the draw -> Use to create new draw call if changes /// - uint textureId; + uint _textureId; } public enum GlVersion diff --git a/Raylib-cs/types/RenderTexture2D.cs b/Raylib-cs/types/RenderTexture2D.cs index 67a70f00..50b063c3 100644 --- a/Raylib-cs/types/RenderTexture2D.cs +++ b/Raylib-cs/types/RenderTexture2D.cs @@ -11,16 +11,16 @@ public partial struct RenderTexture2D /// /// OpenGL Framebuffer Object (FBO) id /// - public uint id; + public uint Id; /// /// Color buffer attachment texture /// - public Texture2D texture; + public Texture2D Texture; /// /// Depth buffer attachment texture /// - public Texture2D depth; + public Texture2D Depth; } } diff --git a/Raylib-cs/types/Shader.cs b/Raylib-cs/types/Shader.cs index 9592b420..ef753df9 100644 --- a/Raylib-cs/types/Shader.cs +++ b/Raylib-cs/types/Shader.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Raylib_cs @@ -75,11 +74,11 @@ public unsafe partial struct Shader /// /// Shader program id /// - public uint id; + public uint Id; /// /// Shader locations array (MAX_SHADER_LOCATIONS, int *) /// - public int* locs; + public int* Locs; } } diff --git a/Raylib-cs/types/Texture2D.cs b/Raylib-cs/types/Texture2D.cs index 93115e25..bbbcd1e6 100644 --- a/Raylib-cs/types/Texture2D.cs +++ b/Raylib-cs/types/Texture2D.cs @@ -112,26 +112,26 @@ public partial struct Texture2D /// /// OpenGL texture id /// - public uint id; + public uint Id; /// /// Texture base width /// - public int width; + public int Width; /// /// Texture base height /// - public int height; + public int Height; /// /// Mipmap levels, 1 by default /// - public int mipmaps; + public int Mipmaps; /// /// Data format (PixelFormat type) /// - public PixelFormat format; + public PixelFormat Format; } } diff --git a/Raylib-cs/types/Transform.cs b/Raylib-cs/types/Transform.cs index c38988cc..b7692ce1 100644 --- a/Raylib-cs/types/Transform.cs +++ b/Raylib-cs/types/Transform.cs @@ -12,16 +12,16 @@ public partial struct Transform /// /// Translation /// - public Vector3 translation; + public Vector3 Translation; /// /// Rotation /// - public Quaternion rotation; + public Quaternion Rotation; /// /// Scale /// - public Vector3 scale; + public Vector3 Scale; } } diff --git a/Raylib-cs/types/native/AnsiBuffer.cs b/Raylib-cs/types/native/AnsiBuffer.cs index 311496af..529359fb 100644 --- a/Raylib-cs/types/native/AnsiBuffer.cs +++ b/Raylib-cs/types/native/AnsiBuffer.cs @@ -8,21 +8,21 @@ namespace Raylib_cs /// public readonly ref struct AnsiBuffer { - private readonly IntPtr data; + private readonly IntPtr _data; public AnsiBuffer(string text) { - data = Marshal.StringToHGlobalAnsi(text); + _data = Marshal.StringToHGlobalAnsi(text); } public unsafe sbyte* AsPointer() { - return (sbyte*)data.ToPointer(); + return (sbyte*)_data.ToPointer(); } public void Dispose() { - Marshal.FreeHGlobal(data); + Marshal.FreeHGlobal(_data); } } diff --git a/Raylib-cs/types/native/CBool.cs b/Raylib-cs/types/native/CBool.cs index 90d551ba..36964ca7 100644 --- a/Raylib-cs/types/native/CBool.cs +++ b/Raylib-cs/types/native/CBool.cs @@ -20,42 +20,42 @@ public readonly struct CBool * * '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. public CBool(bool value) { - this.value = (sbyte)(value ? 1 : 0); + this.Value = (sbyte)(value ? 1 : 0); } public CBool(Int64 value) { - this.value = (sbyte)(value != 0 ? 1 : 0); + this.Value = (sbyte)(value != 0 ? 1 : 0); } // CBool -> Native // Allows for arithmetic between CBools and for assignment to greater integer variables. 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. public static implicit operator bool(CBool x) { - return x.value != 0 ? true : false; + return x.Value != 0 ? true : false; } // Native -> CBool // Allows native booleans to be implicitely constructed into CBools while passing parameters. 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). 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 @@ -69,13 +69,13 @@ public static implicit operator CBool(Int64 x) // Addition 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 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 diff --git a/Raylib-cs/types/native/FilePathList.cs b/Raylib-cs/types/native/FilePathList.cs index a2e33e2a..f2497e3d 100644 --- a/Raylib-cs/types/native/FilePathList.cs +++ b/Raylib-cs/types/native/FilePathList.cs @@ -1,4 +1,3 @@ -using System; using System.Runtime.InteropServices; namespace Raylib_cs @@ -12,16 +11,16 @@ public unsafe struct FilePathList /// /// Filepaths max entries /// - public uint capacity; + public uint Capacity; /// /// Filepaths entries count /// - public uint count; + public uint Count; /// /// Filepaths entries /// - public byte** paths; + public byte** Paths; } } diff --git a/Raylib-cs/types/native/UTF8Buffer.cs b/Raylib-cs/types/native/Utf8Buffer.cs similarity index 74% rename from Raylib-cs/types/native/UTF8Buffer.cs rename to Raylib-cs/types/native/Utf8Buffer.cs index a46f4f3a..200ab75d 100644 --- a/Raylib-cs/types/native/UTF8Buffer.cs +++ b/Raylib-cs/types/native/Utf8Buffer.cs @@ -7,31 +7,31 @@ namespace Raylib_cs /// /// Converts text to a UTF8 buffer for passing to native code /// - public readonly ref struct UTF8Buffer + public readonly ref struct Utf8Buffer { - private readonly IntPtr data; + private readonly IntPtr _data; - public UTF8Buffer(string text) + public Utf8Buffer(string text) { - data = Marshal.StringToCoTaskMemUTF8(text); + _data = Marshal.StringToCoTaskMemUTF8(text); } public unsafe sbyte* AsPointer() { - return (sbyte*)data.ToPointer(); + return (sbyte*)_data.ToPointer(); } public void Dispose() { - Marshal.ZeroFreeCoTaskMemUTF8(data); + Marshal.ZeroFreeCoTaskMemUTF8(_data); } } public static class Utf8StringUtils { - public static UTF8Buffer ToUTF8Buffer(this string text) + public static Utf8Buffer ToUtf8Buffer(this string text) { - return new UTF8Buffer(text); + return new Utf8Buffer(text); } public static byte[] ToUtf8String(this string text)