diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs
index ec9de42..1b65cd2 100644
--- a/Raylib-cs/Raylib.cs
+++ b/Raylib-cs/Raylib.cs
@@ -42,7 +42,7 @@ namespace Raylib_cs
///
/// refers to a void *
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate bool SaveFileDataCallback(string fileName, IntPtr data, ref int bytesToWrite);
+ public delegate CBool SaveFileDataCallback(string fileName, IntPtr data, ref int bytesToWrite);
///
/// FileIO: Load text data
@@ -56,7 +56,7 @@ namespace Raylib_cs
/// WARNING: This callback is intended for advance users
///
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- public delegate bool SaveFileTextCallback(string fileName, string text);
+ public delegate CBool SaveFileTextCallback(string fileName, string text);
///
/// Returns color with alpha applied, alpha goes from 0.0f to 1.0f
@@ -79,8 +79,7 @@ namespace Raylib_cs
/// Check if KEY_ESCAPE pressed or Close icon pressed
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool WindowShouldClose();
+ public static extern CBool WindowShouldClose();
/// Close window and unload OpenGL context
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -88,48 +87,39 @@ namespace Raylib_cs
/// Check if window has been initialized successfully
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsWindowReady();
+ public static extern CBool IsWindowReady();
/// Check if window is currently fullscreen
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsWindowFullscreen();
+ public static extern CBool IsWindowFullscreen();
/// Check if window is currently hidden (only PLATFORM_DESKTOP)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsWindowHidden();
+ public static extern CBool IsWindowHidden();
/// Check if window is currently minimized (only PLATFORM_DESKTOP)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsWindowMinimized();
+ public static extern CBool IsWindowMinimized();
/// Check if window is currently maximized (only PLATFORM_DESKTOP)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsWindowMaximized();
+ public static extern CBool IsWindowMaximized();
/// Check if window is currently focused (only PLATFORM_DESKTOP)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsWindowFocused();
+ public static extern CBool IsWindowFocused();
/// Check if window has been resized last frame
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsWindowResized();
+ public static extern CBool IsWindowResized();
/// Check if one specific window flag is enabled
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsWindowState(ConfigFlags flag);
+ public static extern CBool IsWindowState(ConfigFlags flag);
/// Set window configuration state using flags
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool SetWindowState(ConfigFlags flag);
+ public static extern CBool SetWindowState(ConfigFlags flag);
/// Clear window configuration state flags
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -281,8 +271,7 @@ namespace Raylib_cs
/// Check if cursor is not visible
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsCursorHidden();
+ public static extern CBool IsCursorHidden();
/// Enables cursor (unlock cursor)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -294,8 +283,7 @@ namespace Raylib_cs
/// Disables cursor (lock cursor)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsCursorOnScreen();
+ public static extern CBool IsCursorOnScreen();
// Drawing-related functions
@@ -548,18 +536,15 @@ namespace Raylib_cs
/// Save data to file from byte array (write)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool SaveFileData(string fileName, IntPtr data, int bytesToWrite);
+ public static extern CBool SaveFileData(string fileName, IntPtr data, int bytesToWrite);
/// Check file extension
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsFileExtension(string fileName, string ext);
+ public static extern CBool IsFileExtension(string fileName, string ext);
/// Check if a file has been dropped into window
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsFileDropped();
+ public static extern CBool IsFileDropped();
/// Get dropped files names (memory should be freed)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -586,8 +571,7 @@ namespace Raylib_cs
/// Save integer value to storage file (to defined position)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool SaveStorageValue(uint position, int value);
+ public static extern CBool SaveStorageValue(uint position, int value);
/// Load integer value from storage file (from defined position)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -605,23 +589,19 @@ namespace Raylib_cs
/// Detect if a key has been pressed once
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsKeyPressed(KeyboardKey key);
+ public static extern CBool IsKeyPressed(KeyboardKey key);
/// Detect if a key is being pressed
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsKeyDown(KeyboardKey key);
+ public static extern CBool IsKeyDown(KeyboardKey key);
/// Detect if a key has been released once
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsKeyReleased(KeyboardKey key);
+ public static extern CBool IsKeyReleased(KeyboardKey key);
/// Detect if a key is NOT being pressed
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsKeyUp(KeyboardKey key);
+ public static extern CBool IsKeyUp(KeyboardKey key);
/// Set a custom key to exit program (default is ESC)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -640,8 +620,7 @@ namespace Raylib_cs
/// Detect if a gamepad is available
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsGamepadAvailable(int gamepad);
+ public static extern CBool IsGamepadAvailable(int gamepad);
/// Return gamepad internal name id
[DllImport(nativeLibName, EntryPoint = "GetGamepadName", CallingConvention = CallingConvention.Cdecl)]
@@ -655,23 +634,19 @@ namespace Raylib_cs
/// Detect if a gamepad button has been pressed once
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsGamepadButtonPressed(int gamepad, GamepadButton button);
+ public static extern CBool IsGamepadButtonPressed(int gamepad, GamepadButton button);
/// Detect if a gamepad button is being pressed
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsGamepadButtonDown(int gamepad, GamepadButton button);
+ public static extern CBool IsGamepadButtonDown(int gamepad, GamepadButton button);
/// Detect if a gamepad button has been released once
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsGamepadButtonReleased(int gamepad, GamepadButton button);
+ public static extern CBool IsGamepadButtonReleased(int gamepad, GamepadButton button);
/// Detect if a gamepad button is NOT being pressed
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsGamepadButtonUp(int gamepad, GamepadButton button);
+ public static extern CBool IsGamepadButtonUp(int gamepad, GamepadButton button);
/// Get the last gamepad button pressed
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -694,23 +669,19 @@ namespace Raylib_cs
/// Detect if a mouse button has been pressed once
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsMouseButtonPressed(MouseButton button);
+ public static extern CBool IsMouseButtonPressed(MouseButton button);
/// Detect if a mouse button is being pressed
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsMouseButtonDown(MouseButton button);
+ public static extern CBool IsMouseButtonDown(MouseButton button);
/// Detect if a mouse button has been released once
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsMouseButtonReleased(MouseButton button);
+ public static extern CBool IsMouseButtonReleased(MouseButton button);
/// Detect if a mouse button is NOT being pressed
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsMouseButtonUp(MouseButton button);
+ public static extern CBool IsMouseButtonUp(MouseButton button);
/// Returns mouse position X
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -781,8 +752,7 @@ namespace Raylib_cs
/// Check if a gesture have been detected
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsGestureDetected(Gesture gesture);
+ public static extern CBool IsGestureDetected(Gesture gesture);
/// Get latest detected gesture
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1005,42 +975,35 @@ namespace Raylib_cs
/// Check collision between two rectangles
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2);
+ public static extern CBool CheckCollisionRecs(Rectangle rec1, Rectangle rec2);
/// Check collision between two circles
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2);
+ public static extern CBool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2);
/// Check collision between circle and rectangle
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec);
+ public static extern CBool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec);
/// Check if point is inside rectangle
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionPointRec(Vector2 point, Rectangle rec);
+ public static extern CBool CheckCollisionPointRec(Vector2 point, Rectangle rec);
/// Check if point is inside circle
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius);
+ public static extern CBool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius);
/// Check if point is inside a triangle
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);
+ public static extern CBool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);
/// Check the collision between two lines defined by two points each, returns collision point by reference
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, ref Vector2 collisionPoint);
+ public static extern CBool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, ref Vector2 collisionPoint);
/// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int threshold);
+ 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)]
@@ -1718,7 +1681,7 @@ namespace Raylib_cs
/// Upload vertex data into GPU and provided VAO/VBO ids
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void UploadMesh(ref Mesh mesh, bool dynamic);
+ public static extern void UploadMesh(ref Mesh mesh, CBool dynamic);
/// Update mesh vertex data in GPU for a specific buffer index
/// data refers to a void *
@@ -1739,8 +1702,7 @@ namespace Raylib_cs
/// Export mesh data to file, returns true on success
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool ExportMesh(Mesh mesh, string fileName);
+ public static extern CBool ExportMesh(Mesh mesh, string fileName);
/// Compute mesh bounding box limits
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1757,8 +1719,8 @@ namespace Raylib_cs
// Material loading/unloading functions
- /// Load materials from model file
- /// IntPtr refers to Material *
+ /// Load materials from model file
+ /// IntPtr refers to Material *
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr LoadMaterials(string fileName, ref int materialCount);
@@ -1880,30 +1842,25 @@ namespace Raylib_cs
/// Check model animation skeleton match
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsModelAnimationValid(Model model, ModelAnimation anim);
+ public static extern CBool IsModelAnimationValid(Model model, ModelAnimation anim);
// Collision detection functions
/// Detect collision between two spheres
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2);
+ public static extern CBool CheckCollisionSpheres(Vector3 center1, float radius1, Vector3 center2, float radius2);
/// Detect collision between two bounding boxes
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);
+ public static extern CBool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);
/// Detect collision between box and sphere
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius);
+ public static extern CBool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius);
/// Detect collision between ray and sphere
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool GetRayCollisionSphere(Ray ray, Vector3 center, float radius);
+ public static extern CBool GetRayCollisionSphere(Ray ray, Vector3 center, float radius);
/// Detect collision between ray and box
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -1942,8 +1899,7 @@ namespace Raylib_cs
/// Check if audio device has been initialized successfully
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsAudioDeviceReady();
+ public static extern CBool IsAudioDeviceReady();
/// Set master volume (listener)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -2023,8 +1979,7 @@ namespace Raylib_cs
/// Check if a sound is currently playing
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsSoundPlaying(Sound sound);
+ public static extern CBool IsSoundPlaying(Sound sound);
/// Set volume for a sound (1.0 is max level)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -2076,8 +2031,7 @@ namespace Raylib_cs
/// Check if music is playing
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsMusicStreamPlaying(Music music);
+ public static extern CBool IsMusicStreamPlaying(Music music);
/// Updates buffers for music streaming
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -2133,8 +2087,7 @@ namespace Raylib_cs
/// Check if any audio stream buffers requires refill
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsAudioStreamProcessed(AudioStream stream);
+ public static extern CBool IsAudioStreamProcessed(AudioStream stream);
/// Play audio stream
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -2150,8 +2103,7 @@ namespace Raylib_cs
/// Check if audio stream is playing
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool IsAudioStreamPlaying(AudioStream stream);
+ public static extern CBool IsAudioStreamPlaying(AudioStream stream);
/// Stop audio stream
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
diff --git a/Raylib-cs/RaylibUtils.cs b/Raylib-cs/RaylibUtils.cs
index 57e5780..c065007 100644
--- a/Raylib-cs/RaylibUtils.cs
+++ b/Raylib-cs/RaylibUtils.cs
@@ -4,6 +4,32 @@ using Raylib_cs;
namespace Raylib_cs
{
+ [StructLayout(LayoutKind.Sequential)]
+ public readonly struct CBool
+ {
+ private readonly byte value;
+
+ private CBool(bool value)
+ {
+ this.value = Convert.ToByte(value);
+ }
+
+ public static implicit operator CBool(bool value)
+ {
+ return new CBool(value);
+ }
+
+ public static implicit operator bool(CBool x)
+ {
+ return Convert.ToBoolean(x.value);
+ }
+
+ public override string ToString()
+ {
+ return Convert.ToBoolean(value).ToString();
+ }
+ }
+
///
/// Utility functions for parts of the api that are not easy to interact with via pinvoke.
///
diff --git a/Raylib-cs/Rlgl.cs b/Raylib-cs/Rlgl.cs
index f0bb0d8..d49264d 100644
--- a/Raylib-cs/Rlgl.cs
+++ b/Raylib-cs/Rlgl.cs
@@ -200,8 +200,7 @@ namespace Raylib_cs
/// Enable vertex array (VAO, if supported)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool rlEnableVertexArray(uint vaoId);
+ public static extern CBool rlEnableVertexArray(uint vaoId);
/// Disable vertex array (VAO, if supported)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -353,8 +352,7 @@ namespace Raylib_cs
/// Check if stereo render is enabled
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool rlIsStereoRenderEnabled();
+ public static extern CBool rlIsStereoRenderEnabled();
/// Clear color buffer with color
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -439,8 +437,7 @@ namespace Raylib_cs
/// Check internal buffer overflow for a given number of vertex
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool rlCheckRenderBatchLimit(int vCount);
+ public static extern CBool rlCheckRenderBatchLimit(int vCount);
/// Set current texture for render batch and check buffers limits
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -455,11 +452,11 @@ namespace Raylib_cs
/// Load a vertex buffer attribute
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern uint rlLoadVertexBuffer(IntPtr buffer, int size, bool dynamic);
+ public static extern uint rlLoadVertexBuffer(IntPtr buffer, int size, CBool dynamic);
/// Load a new attributes element buffer
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern uint rlLoadVertexBufferElement(IntPtr buffer, int size, bool dynamic);
+ public static extern uint rlLoadVertexBufferElement(IntPtr buffer, int size, CBool dynamic);
/// Update GPU buffer with new data
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@@ -472,7 +469,7 @@ namespace Raylib_cs
public static extern void rlUnloadVertexBuffer(uint vboId);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern void rlSetVertexAttribute(uint index, int compSize, int type, bool normalized, int stride, IntPtr pointer);
+ public static extern void rlSetVertexAttribute(uint index, int compSize, int type, CBool normalized, int stride, IntPtr pointer);
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlSetVertexAttributeDivisor(uint index, int divisor);
@@ -503,7 +500,7 @@ namespace Raylib_cs
/// Load depth texture/renderbuffer (to be attached to fbo)
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern uint rlLoadTextureDepth(int width, int height, bool useRenderBuffer);
+ public static extern uint rlLoadTextureDepth(int width, int height, CBool useRenderBuffer);
/// Load texture cubemap
/// data refers to a void *
@@ -550,13 +547,11 @@ namespace Raylib_cs
/// Verify framebuffer is complete
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool rlFramebufferComplete(uint id);
+ public static extern CBool rlFramebufferComplete(uint id);
/// Delete framebuffer from GPU
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
- [return: MarshalAs(UnmanagedType.I1)]
- public static extern bool rlUnloadFramebuffer(uint id);
+ public static extern CBool rlUnloadFramebuffer(uint id);
// Shaders management