diff --git a/raylib-api b/raylib-api index 5e9f155..9903826 160000 --- a/raylib-api +++ b/raylib-api @@ -1 +1 @@ -Subproject commit 5e9f1551c3a394c63a7080c093e51c621cac4159 +Subproject commit 9903826e3e3c401ff1c8b3010e566f1e07df262c diff --git a/raylib-beef/example/BeefSpace.toml b/raylib-beef/example/BeefSpace.toml new file mode 100644 index 0000000..9745a50 --- /dev/null +++ b/raylib-beef/example/BeefSpace.toml @@ -0,0 +1,5 @@ +FileVersion = 1 +Projects = {example = {Path = "."}, raylib-beef = {Path = ".."}} + +[Workspace] +StartupProject = "example" diff --git a/raylib-beef/libs/libs_x64/raylib.dll b/raylib-beef/libs/libs_x64/raylib.dll index 6424378..eff01fd 100644 Binary files a/raylib-beef/libs/libs_x64/raylib.dll and b/raylib-beef/libs/libs_x64/raylib.dll differ diff --git a/raylib-beef/libs/libs_x64/raylib.lib b/raylib-beef/libs/libs_x64/raylib.lib deleted file mode 100644 index 9c14cfd..0000000 Binary files a/raylib-beef/libs/libs_x64/raylib.lib and /dev/null differ diff --git a/raylib-beef/libs/libs_x64/raylibdll.lib b/raylib-beef/libs/libs_x64/raylibdll.lib index 3665ba9..e2c4b11 100644 Binary files a/raylib-beef/libs/libs_x64/raylibdll.lib and b/raylib-beef/libs/libs_x64/raylibdll.lib differ diff --git a/raylib-beef/libs/libs_x64/staticraylib.lib b/raylib-beef/libs/libs_x64/staticraylib.lib index 24f0ff4..2e2d80d 100644 Binary files a/raylib-beef/libs/libs_x64/staticraylib.lib and b/raylib-beef/libs/libs_x64/staticraylib.lib differ diff --git a/raylib-beef/libs/linux_x64/libraylib.a b/raylib-beef/libs/linux_x64/libraylib.a index 69791ca..e6256ce 100644 Binary files a/raylib-beef/libs/linux_x64/libraylib.a and b/raylib-beef/libs/linux_x64/libraylib.a differ diff --git a/raylib-beef/libs/linux_x64/libraylib.so b/raylib-beef/libs/linux_x64/libraylib.so index be7530a..c8f33b9 100755 Binary files a/raylib-beef/libs/linux_x64/libraylib.so and b/raylib-beef/libs/linux_x64/libraylib.so differ diff --git a/raylib-beef/libs/wasm/libraylib.a b/raylib-beef/libs/wasm/libraylib.a deleted file mode 100644 index 2d6576d..0000000 Binary files a/raylib-beef/libs/wasm/libraylib.a and /dev/null differ diff --git a/raylib-beef/src/CameraMode.bf b/raylib-beef/src/CameraMode.bf index 63eae93..464710d 100644 --- a/raylib-beef/src/CameraMode.bf +++ b/raylib-beef/src/CameraMode.bf @@ -7,15 +7,15 @@ namespace RaylibBeef; /// Camera system modes public enum CameraMode : c_int { - /// Custom camera + /// Camera custom, controlled by user (UpdateCamera() does nothing) case CAMERA_CUSTOM = 0; - /// Free camera + /// Camera free mode case CAMERA_FREE = 1; - /// Orbital camera + /// Camera orbital, around target, zoom supported case CAMERA_ORBITAL = 2; - /// First person camera + /// Camera first person case CAMERA_FIRST_PERSON = 3; - /// Third person camera + /// Camera third person case CAMERA_THIRD_PERSON = 4; public static operator int32 (CameraMode self) => (int32)self; diff --git a/raylib-beef/src/CubemapLayout.bf b/raylib-beef/src/CubemapLayout.bf index a45f27e..4458899 100644 --- a/raylib-beef/src/CubemapLayout.bf +++ b/raylib-beef/src/CubemapLayout.bf @@ -17,8 +17,6 @@ public enum CubemapLayout : c_int case CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3; /// Layout is defined by a 4x3 cross with cubemap faces case CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4; - /// Layout is defined by a panorama image (equirrectangular map) - case CUBEMAP_LAYOUT_PANORAMA = 5; public static operator int32 (CubemapLayout self) => (int32)self; } diff --git a/raylib-beef/src/GamepadButton.bf b/raylib-beef/src/GamepadButton.bf index 80aa77d..7ba88e3 100644 --- a/raylib-beef/src/GamepadButton.bf +++ b/raylib-beef/src/GamepadButton.bf @@ -19,17 +19,17 @@ public enum GamepadButton : c_int case GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4; /// Gamepad right button up (i.e. PS3: Triangle, Xbox: Y) case GAMEPAD_BUTTON_RIGHT_FACE_UP = 5; - /// Gamepad right button right (i.e. PS3: Square, Xbox: X) + /// Gamepad right button right (i.e. PS3: Circle, Xbox: B) case GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6; /// Gamepad right button down (i.e. PS3: Cross, Xbox: A) case GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7; - /// Gamepad right button left (i.e. PS3: Circle, Xbox: B) + /// Gamepad right button left (i.e. PS3: Square, Xbox: X) case GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8; /// Gamepad top/back trigger left (first), it could be a trailing button case GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9; /// Gamepad top/back trigger left (second), it could be a trailing button case GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10; - /// Gamepad top/back trigger right (one), it could be a trailing button + /// Gamepad top/back trigger right (first), it could be a trailing button case GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11; /// Gamepad top/back trigger right (second), it could be a trailing button case GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12; diff --git a/raylib-beef/src/KeyboardKey.bf b/raylib-beef/src/KeyboardKey.bf index 4b2fd55..0b29230 100644 --- a/raylib-beef/src/KeyboardKey.bf +++ b/raylib-beef/src/KeyboardKey.bf @@ -222,7 +222,7 @@ public enum KeyboardKey : c_int /// Key: Android back button case KEY_BACK = 4; /// Key: Android menu button - case KEY_MENU = 82; + case KEY_MENU = 5; /// Key: Android volume up button case KEY_VOLUME_UP = 24; /// Key: Android volume down button diff --git a/raylib-beef/src/Mesh.bf b/raylib-beef/src/Mesh.bf index b0d9926..be18773 100644 --- a/raylib-beef/src/Mesh.bf +++ b/raylib-beef/src/Mesh.bf @@ -39,19 +39,25 @@ public struct Mesh /// Animated normals (after bones transformations) public void* animNormals; - /// Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) + /// Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning) (shader-location = 6) public void* boneIds; - /// Vertex bone weight, up to 4 bones influence by vertex (skinning) + /// Vertex bone weight, up to 4 bones influence by vertex (skinning) (shader-location = 7) public void* boneWeights; + /// Bones animated transformation matrices + public Matrix * boneMatrices; + + /// Number of bones + public int32 boneCount; + /// OpenGL Vertex Array Object id public int32 vaoId; /// OpenGL Vertex Buffer Objects id (default vertex data) public void* vboId; - public this(int32 vertexCount, int32 triangleCount, void* vertices, void* texcoords, void* texcoords2, void* normals, void* tangents, void* colors, void* indices, void* animVertices, void* animNormals, void* boneIds, void* boneWeights, int32 vaoId, void* vboId) + public this(int32 vertexCount, int32 triangleCount, void* vertices, void* texcoords, void* texcoords2, void* normals, void* tangents, void* colors, void* indices, void* animVertices, void* animNormals, void* boneIds, void* boneWeights, Matrix * boneMatrices, int32 boneCount, int32 vaoId, void* vboId) { this.vertexCount = vertexCount; this.triangleCount = triangleCount; @@ -66,6 +72,8 @@ public struct Mesh this.animNormals = animNormals; this.boneIds = boneIds; this.boneWeights = boneWeights; + this.boneMatrices = boneMatrices; + this.boneCount = boneCount; this.vaoId = vaoId; this.vboId = vboId; } diff --git a/raylib-beef/src/Ray.bf b/raylib-beef/src/Ray.bf index 1fdb801..0395007 100644 --- a/raylib-beef/src/Ray.bf +++ b/raylib-beef/src/Ray.bf @@ -9,7 +9,7 @@ public struct Ray /// Ray position (origin) public Vector3 position; - /// Ray direction + /// Ray direction (normalized) public Vector3 direction; public this(Vector3 position, Vector3 direction) diff --git a/raylib-beef/src/Raylib.bf b/raylib-beef/src/Raylib.bf index 3264cef..ef536b9 100644 --- a/raylib-beef/src/Raylib.bf +++ b/raylib-beef/src/Raylib.bf @@ -7,11 +7,11 @@ public static class Raylib { public const int32 RAYLIB_VERSION_MAJOR = 5; - public const int32 RAYLIB_VERSION_MINOR = 0; + public const int32 RAYLIB_VERSION_MINOR = 5; public const int32 RAYLIB_VERSION_PATCH = 0; - public const char8* RAYLIB_VERSION = "5.0"; + public const char8* RAYLIB_VERSION = "5.5"; public const float PI = 3.141592653589793f; @@ -117,19 +117,19 @@ public static class Raylib [CLink] public static extern bool IsWindowFullscreen(); - /// Check if window is currently hidden (only PLATFORM_DESKTOP) + /// Check if window is currently hidden [CLink] public static extern bool IsWindowHidden(); - /// Check if window is currently minimized (only PLATFORM_DESKTOP) + /// Check if window is currently minimized [CLink] public static extern bool IsWindowMinimized(); - /// Check if window is currently maximized (only PLATFORM_DESKTOP) + /// Check if window is currently maximized [CLink] public static extern bool IsWindowMaximized(); - /// Check if window is currently focused (only PLATFORM_DESKTOP) + /// Check if window is currently focused [CLink] public static extern bool IsWindowFocused(); @@ -142,7 +142,7 @@ public static class Raylib public static extern bool IsWindowState(int32 flag); public static bool IsWindowState(ConfigFlags flag) => IsWindowState((int32)flag); - /// Set window configuration state using flags (only PLATFORM_DESKTOP) + /// Set window configuration state using flags [CLink] public static extern void SetWindowState(int32 flags); public static void SetWindowState(ConfigFlags flag) => SetWindowState((int32)flag); @@ -152,35 +152,35 @@ public static class Raylib public static extern void ClearWindowState(int32 flags); public static void ClearWindowState(ConfigFlags flag) => ClearWindowState((int32)flag); - /// Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) + /// Toggle window state: fullscreen/windowed, resizes monitor to match window resolution [CLink] public static extern void ToggleFullscreen(); - /// Toggle window state: borderless windowed (only PLATFORM_DESKTOP) + /// Toggle window state: borderless windowed, resizes window to match monitor resolution [CLink] public static extern void ToggleBorderlessWindowed(); - /// Set window state: maximized, if resizable (only PLATFORM_DESKTOP) + /// Set window state: maximized, if resizable [CLink] public static extern void MaximizeWindow(); - /// Set window state: minimized, if resizable (only PLATFORM_DESKTOP) + /// Set window state: minimized, if resizable [CLink] public static extern void MinimizeWindow(); - /// Set window state: not minimized/maximized (only PLATFORM_DESKTOP) + /// Set window state: not minimized/maximized [CLink] public static extern void RestoreWindow(); - /// Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP) + /// Set icon for window (multiple images, RGBA 32bit) [CLink] public static extern void SetWindowIcons(Image *images, int32 count); - /// Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB) + /// Set title for window [CLink] public static extern void SetWindowTitle(char8 *title); - /// Set window position on screen (only PLATFORM_DESKTOP) + /// Set window position on screen [CLink] public static extern void SetWindowPosition(int32 x, int32 y); @@ -200,11 +200,11 @@ public static class Raylib [CLink] public static extern void SetWindowSize(int32 width, int32 height); - /// Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP) + /// Set window opacity [0.0f..1.0f] [CLink] public static extern void SetWindowOpacity(float opacity); - /// Set window focused (only PLATFORM_DESKTOP) + /// Set window focused [CLink] public static extern void SetWindowFocused(); @@ -232,7 +232,7 @@ public static class Raylib [CLink] public static extern int32 GetMonitorCount(); - /// Get current connected monitor + /// Get current monitor where window is placed [CLink] public static extern int32 GetCurrentMonitor(); @@ -280,6 +280,10 @@ public static class Raylib [CLink] public static extern char8 * GetClipboardText(); + /// Get clipboard image content + [CLink] + public static extern Image GetClipboardImage(); + /// Enable waiting for events on EndDrawing(), no automatic event polling [CLink] public static extern void EnableEventWaiting(); @@ -535,6 +539,10 @@ public static class Raylib [CLink] public static extern char8 * GetApplicationDirectory(); + /// Create directories (including full path requested), returns 0 on success + [CLink] + public static extern int32 MakeDirectory(char8 *dirPath); + /// Change working directory, return true on success [CLink] public static extern bool ChangeDirectory(char8 *dir); @@ -543,11 +551,15 @@ public static class Raylib [CLink] public static extern bool IsPathFile(char8 *path); + /// Check if fileName is valid for the platform/OS + [CLink] + public static extern bool IsFileNameValid(char8 *fileName); + /// Load directory filepaths [CLink] public static extern FilePathList LoadDirectoryFiles(char8 *dirPath); - /// Load directory filepaths with extension filtering and recursive directory scan + /// Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result [CLink] public static extern FilePathList LoadDirectoryFilesEx(char8 *basePath, char8 *filter, bool scanSubdirs); @@ -579,14 +591,22 @@ public static class Raylib [CLink] public static extern char8 * DecodeDataBase64(char8 *data, int32 *outputSize); + /// Compute CRC32 hash code + [CLink] + public static extern int32 ComputeCRC32(char8 *data, int32 dataSize); + + /// Compute MD5 hash code, returns static int[4] (16 bytes) + [CLink] + public static extern int32 * ComputeMD5(char8 *data, int32 dataSize); + + /// Compute SHA1 hash code, returns static int[5] (20 bytes) + [CLink] + public static extern int32 * ComputeSHA1(char8 *data, int32 dataSize); + /// Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS [CLink] public static extern AutomationEventList LoadAutomationEventList(char8 *fileName); - /// Unload automation events list from file - [CLink] - public static extern void UnloadAutomationEventList(AutomationEventList *list); - /// Set automation event list to record to [CLink] public static extern void SetAutomationEventList(AutomationEventList *list); @@ -608,7 +628,7 @@ public static class Raylib public static extern bool IsKeyPressed(int32 key); public static bool IsKeyPressed(KeyboardKey key) => IsKeyPressed((int32)key); - /// Check if a key has been pressed again (Only PLATFORM_DESKTOP) + /// Check if a key has been pressed again [CLink] public static extern bool IsKeyPressedRepeat(int32 key); public static bool IsKeyPressedRepeat(KeyboardKey key) => IsKeyPressedRepeat((int32)key); @@ -686,6 +706,10 @@ public static class Raylib [CLink] public static extern int32 SetGamepadMappings(char8 *mappings); + /// Set gamepad vibration for both motors (duration in seconds) + [CLink] + public static extern void SetGamepadVibration(int32 gamepad, float leftMotor, float rightMotor, float duration); + /// Check if a mouse button has been pressed once [CLink] public static extern bool IsMouseButtonPressed(int32 button); @@ -781,7 +805,7 @@ public static class Raylib [CLink] public static extern int32 GetGestureDetected(); - /// Get gesture hold time in milliseconds + /// Get gesture hold time in seconds [CLink] public static extern float GetGestureHoldDuration(); @@ -806,6 +830,14 @@ public static class Raylib public static extern void UpdateCamera(Camera *camera, int32 mode); public static void UpdateCamera(Camera *camera, CameraMode mode) => UpdateCamera(camera, (int32)mode); + /// Get texture that is used for shapes drawing + [CLink] + public static extern Texture2D GetShapesTexture(); + + /// Get texture source rectangle that is used for shapes drawing + [CLink] + public static extern Rectangle GetShapesTextureRectangle(); + /// Load image from file into CPU memory (RAM) [CLink] public static extern Image LoadImage(char8 *fileName); @@ -814,14 +846,14 @@ public static class Raylib [CLink] public static extern Image LoadImageRaw(char8 *fileName, int32 width, int32 height, int32 format, int32 headerSize); - /// Load image from SVG file data or string with specified size - [CLink] - public static extern Image LoadImageSvg(char8 *fileNameOrString, int32 width, int32 height); - /// Load image sequence from file (frames appended to image.data) [CLink] public static extern Image LoadImageAnim(char8 *fileName, int32 *frames); + /// Load image sequence from memory buffer + [CLink] + public static extern Image LoadImageAnimFromMemory(char8 *fileType, char8 *fileData, int32 dataSize, int32 *frames); + /// Load image from memory buffer, fileType refers to extension: i.e. '.png' [CLink] public static extern Image LoadImageFromMemory(char8 *fileType, char8 *fileData, int32 dataSize); @@ -862,6 +894,10 @@ public static class Raylib [CLink] public static extern void ImageBlurGaussian(Image *image, int32 blurSize); + /// Apply custom square convolution kernel to image + [CLink] + public static extern void ImageKernelConvolution(Image *image, float *kernel, int32 kernelSize); + /// Resize image (Bicubic scaling algorithm) [CLink] public static extern void ImageResize(Image *image, int32 newWidth, int32 newHeight); @@ -958,7 +994,7 @@ public static class Raylib [CLink] public static extern Font LoadFont(char8 *fileName); - /// Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont + /// Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character set, font size is provided in pixels height [CLink] public static extern Font LoadFontEx(char8 *fileName, int32 fontSize, int32 *codepoints, int32 codepointCount); @@ -1082,10 +1118,22 @@ public static class Raylib [CLink] public static extern char8 * TextToPascal(char8 *text); + /// Get Snake case notation version of provided string + [CLink] + public static extern char8 * TextToSnake(char8 *text); + + /// Get Camel case notation version of provided string + [CLink] + public static extern char8 * TextToCamel(char8 *text); + /// Get integer value from text (negative values not supported) [CLink] public static extern int32 TextToInteger(char8 *text); + /// Get float value from text (negative values not supported) + [CLink] + public static extern float TextToFloat(char8 *text); + /// Draw a grid (centered at (0, 0, 0)) [CLink] public static extern void DrawGrid(int32 slices, float spacing); @@ -1190,9 +1238,9 @@ public static class Raylib [CLink] public static extern Sound LoadSound(char8 *fileName); - /// Crop a wave to defined samples range + /// Crop a wave to defined frames range [CLink] - public static extern void WaveCrop(Wave *wave, int32 initSample, int32 finalSample); + public static extern void WaveCrop(Wave *wave, int32 initFrame, int32 finalFrame); /// Convert wave data to desired format [CLink] @@ -1218,7 +1266,7 @@ public static class Raylib [CLink] public static extern void SetAudioStreamBufferSizeDefault(int32 size); - /// Attach audio stream processor to the entire audio pipeline, receives the samples as s + /// Attach audio stream processor to the entire audio pipeline, receives the samples as 'float' [CLink] public static extern void AttachAudioMixedProcessor(AudioCallback processor); @@ -1228,7 +1276,7 @@ public static class Raylib #if !BF_PLATFORM_WASM - /// Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP) + /// Set icon for window (single image, RGBA 32bit) [CLink] public static extern void SetWindowIcon(Image image); @@ -1264,9 +1312,9 @@ public static class Raylib [CLink] public static extern void UnloadVrStereoConfig(VrStereoConfig config); - /// Check if a shader is ready + /// Check if a shader is valid (loaded on GPU) [CLink] - public static extern bool IsShaderReady(Shader shader); + public static extern bool IsShaderValid(Shader shader); /// Get shader uniform location [CLink] @@ -1296,26 +1344,18 @@ public static class Raylib [CLink] public static extern void UnloadShader(Shader shader); - /// Get a ray trace from mouse position + /// Get a ray trace from screen position (i.e mouse) [CLink] - public static extern Ray GetMouseRay(Vector2 mousePosition, Camera camera); + public static extern Ray GetScreenToWorldRay(Vector2 position, Camera camera); - /// Get camera transform matrix (view matrix) + /// Get a ray trace from screen position (i.e mouse) in a viewport [CLink] - public static extern Matrix GetCameraMatrix(Camera camera); - - /// Get camera 2d transform matrix - [CLink] - public static extern Matrix GetCameraMatrix2D(Camera2D camera); + public static extern Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int32 width, int32 height); /// Get the screen space position for a 3d world space position [CLink] public static extern Vector2 GetWorldToScreen(Vector3 position, Camera camera); - /// Get the world space position for a 2d camera screen space position - [CLink] - public static extern Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); - /// Get size position for a 3d world space position [CLink] public static extern Vector2 GetWorldToScreenEx(Vector3 position, Camera camera, int32 width, int32 height); @@ -1324,6 +1364,18 @@ public static class Raylib [CLink] public static extern Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); + /// Get the world space position for a 2d camera screen space position + [CLink] + public static extern Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); + + /// Get camera transform matrix (view matrix) + [CLink] + public static extern Matrix GetCameraMatrix(Camera camera); + + /// Get camera 2d transform matrix + [CLink] + public static extern Matrix GetCameraMatrix2D(Camera2D camera); + /// Unload filepaths [CLink] public static extern void UnloadDirectoryFiles(FilePathList files); @@ -1332,6 +1384,10 @@ public static class Raylib [CLink] public static extern void UnloadDroppedFiles(FilePathList files); + /// Unload automation events list from file + [CLink] + public static extern void UnloadAutomationEventList(AutomationEventList list); + /// Export automation events list as text file [CLink] public static extern bool ExportAutomationEventList(AutomationEventList list, char8 *fileName); @@ -1348,11 +1404,11 @@ public static class Raylib [CLink] public static extern void SetShapesTexture(Texture2D texture, Rectangle source); - /// Draw a pixel + /// Draw a pixel using geometry [Can be slow, use with care] [CLink] public static extern void DrawPixel(int32 posX, int32 posY, Color color); - /// Draw a pixel (Vector version) + /// Draw a pixel using geometry (Vector version) [Can be slow, use with care] [CLink] public static extern void DrawPixelV(Vector2 position, Color color); @@ -1390,7 +1446,7 @@ public static class Raylib /// Draw a gradient-filled circle [CLink] - public static extern void DrawCircleGradient(int32 centerX, int32 centerY, float radius, Color color1, Color color2); + public static extern void DrawCircleGradient(int32 centerX, int32 centerY, float radius, Color inner, Color outer); /// Draw a color-filled circle (Vector version) [CLink] @@ -1438,15 +1494,15 @@ public static class Raylib /// Draw a vertical-gradient-filled rectangle [CLink] - public static extern void DrawRectangleGradientV(int32 posX, int32 posY, int32 width, int32 height, Color color1, Color color2); + public static extern void DrawRectangleGradientV(int32 posX, int32 posY, int32 width, int32 height, Color top, Color bottom); /// Draw a horizontal-gradient-filled rectangle [CLink] - public static extern void DrawRectangleGradientH(int32 posX, int32 posY, int32 width, int32 height, Color color1, Color color2); + public static extern void DrawRectangleGradientH(int32 posX, int32 posY, int32 width, int32 height, Color left, Color right); /// Draw a gradient-filled rectangle with custom vertex colors [CLink] - public static extern void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); + public static extern void DrawRectangleGradientEx(Rectangle rec, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight); /// Draw rectangle outline [CLink] @@ -1460,9 +1516,13 @@ public static class Raylib [CLink] public static extern void DrawRectangleRounded(Rectangle rec, float roundness, int32 segments, Color color); + /// Draw rectangle lines with rounded edges + [CLink] + public static extern void DrawRectangleRoundedLines(Rectangle rec, float roundness, int32 segments, Color color); + /// Draw rectangle with rounded edges outline [CLink] - public static extern void DrawRectangleRoundedLines(Rectangle rec, float roundness, int32 segments, float lineThick, Color color); + public static extern void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int32 segments, float lineThick, Color color); /// Draw a color-filled triangle (vertex in counter-clockwise order!) [CLink] @@ -1564,6 +1624,10 @@ public static class Raylib [CLink] public static extern bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); + /// Check if circle collides with a line created betweeen two points [p1] and [p2] + [CLink] + public static extern bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Vector2 p2); + /// Check if point is inside rectangle [CLink] public static extern bool CheckCollisionPointRec(Vector2 point, Rectangle rec); @@ -1576,6 +1640,10 @@ public static class Raylib [CLink] public static extern bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); + /// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] + [CLink] + public static extern bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int32 threshold); + /// Check if point is within a polygon described by array of vertices [CLink] public static extern bool CheckCollisionPointPoly(Vector2 point, Vector2 *points, int32 pointCount); @@ -1584,10 +1652,6 @@ public static class Raylib [CLink] public static extern bool CheckCollisionLines(Vector2 startPos1, Vector2 endPos1, Vector2 startPos2, Vector2 endPos2, Vector2 *collisionPoint); - /// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] - [CLink] - public static extern bool CheckCollisionPointLine(Vector2 point, Vector2 p1, Vector2 p2, int32 threshold); - /// Get collision rectangle for two rectangles collision [CLink] public static extern Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); @@ -1596,9 +1660,9 @@ public static class Raylib [CLink] public static extern Image LoadImageFromTexture(Texture2D texture); - /// Check if an image is ready + /// Check if an image is valid (data and parameters) [CLink] - public static extern bool IsImageReady(Image image); + public static extern bool IsImageValid(Image image); /// Unload image from CPU memory (RAM) [CLink] @@ -1644,6 +1708,10 @@ public static class Raylib [CLink] public static extern Image ImageFromImage(Image image, Rectangle rec); + /// Create an image from a selected channel of another image (GRAYSCALE) + [CLink] + public static extern Image ImageFromChannel(Image image, int32 selectedChannel); + /// Create an image from text (default font) [CLink] public static extern Image ImageText(char8 *text, int32 fontSize, Color color); @@ -1716,6 +1784,10 @@ public static class Raylib [CLink] public static extern void ImageDrawLineV(Image *dst, Vector2 start, Vector2 end, Color color); + /// Draw a line defining thickness within an image + [CLink] + public static extern void ImageDrawLineEx(Image *dst, Vector2 start, Vector2 end, int32 thick, Color color); + /// Draw a filled circle within an image [CLink] public static extern void ImageDrawCircle(Image *dst, int32 centerX, int32 centerY, int32 radius, Color color); @@ -1748,6 +1820,26 @@ public static class Raylib [CLink] public static extern void ImageDrawRectangleLines(Image *dst, Rectangle rec, int32 thick, Color color); + /// Draw triangle within an image + [CLink] + public static extern void ImageDrawTriangle(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); + + /// Draw triangle with interpolated colors within an image + [CLink] + public static extern void ImageDrawTriangleEx(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color c1, Color c2, Color c3); + + /// Draw triangle outline within an image + [CLink] + public static extern void ImageDrawTriangleLines(Image *dst, Vector2 v1, Vector2 v2, Vector2 v3, Color color); + + /// Draw a triangle fan defined by points within an image (first vertex is the center) + [CLink] + public static extern void ImageDrawTriangleFan(Image *dst, Vector2 *points, int32 pointCount, Color color); + + /// Draw a triangle strip defined by points within an image + [CLink] + public static extern void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int32 pointCount, Color color); + /// Draw a source image within a destination image (tint applied to source) [CLink] public static extern void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); @@ -1768,17 +1860,17 @@ public static class Raylib [CLink] public static extern TextureCubemap LoadTextureCubemap(Image image, int32 layout); - /// Check if a texture is ready + /// Check if a texture is valid (loaded in GPU) [CLink] - public static extern bool IsTextureReady(Texture2D texture); + public static extern bool IsTextureValid(Texture2D texture); /// Unload texture from GPU memory (VRAM) [CLink] public static extern void UnloadTexture(Texture2D texture); - /// Check if a render texture is ready + /// Check if a render texture is valid (loaded in GPU) [CLink] - public static extern bool IsRenderTextureReady(RenderTexture2D target); + public static extern bool IsRenderTextureValid(RenderTexture2D target); /// Unload render texture from GPU memory (VRAM) [CLink] @@ -1824,11 +1916,15 @@ public static class Raylib [CLink] public static extern void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle dest, Vector2 origin, float rotation, Color tint); + /// Check if two colors are equal + [CLink] + public static extern bool ColorIsEqual(Color col1, Color col2); + /// Get color with alpha applied, alpha goes from 0.0f to 1.0f [CLink] public static extern Color Fade(Color color, float alpha); - /// Get hexadecimal value for a Color + /// Get hexadecimal value for a Color (0xRRGGBBAA) [CLink] public static extern int32 ColorToInt(Color color); @@ -1864,6 +1960,10 @@ public static class Raylib [CLink] public static extern Color ColorAlphaBlend(Color dst, Color src, Color tint); + /// Get color lerp interpolation between two colors, factor [0.0f..1.0f] + [CLink] + public static extern Color ColorLerp(Color color1, Color color2, float factor); + /// Set color formatted into destination pixel pointer [CLink] public static extern void SetPixelColor(void *dstPtr, Color color, int32 format); @@ -1872,9 +1972,9 @@ public static class Raylib [CLink] public static extern Font LoadFontFromImage(Image image, Color key, int32 firstChar); - /// Check if a font is ready + /// Check if a font is valid (font data loaded, WARNING: GPU texture not checked) [CLink] - public static extern bool IsFontReady(Font font); + public static extern bool IsFontValid(Font font); /// Unload font from GPU memory (VRAM) [CLink] @@ -2004,9 +2104,9 @@ public static class Raylib [CLink] public static extern Model LoadModelFromMesh(Mesh mesh); - /// Check if a model is ready + /// Check if a model is valid (loaded in GPU, VAO/VBOs) [CLink] - public static extern bool IsModelReady(Model model); + public static extern bool IsModelValid(Model model); /// Unload model (including meshes) from memory (RAM and/or VRAM) [CLink] @@ -2032,13 +2132,21 @@ public static class Raylib [CLink] public static extern void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); + /// Draw a model as points + [CLink] + public static extern void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); + + /// Draw a model as points with extended parameters + [CLink] + public static extern void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); + /// Draw bounding box (wires) [CLink] public static extern void DrawBoundingBox(BoundingBox @box, Color color); /// Draw a billboard texture [CLink] - public static extern void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float size, Color tint); + public static extern void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); /// Draw a billboard texture defined by source [CLink] @@ -2064,13 +2172,17 @@ public static class Raylib [CLink] public static extern void DrawMeshInstanced(Mesh mesh, Material material, Matrix *transforms, int32 instances); + /// Compute mesh bounding box limits + [CLink] + public static extern BoundingBox GetMeshBoundingBox(Mesh mesh); + /// Export mesh data to file, returns true on success [CLink] public static extern bool ExportMesh(Mesh mesh, char8 *fileName); - /// Compute mesh bounding box limits + /// Export mesh as code file (.h) defining multiple arrays of vertex attributes [CLink] - public static extern BoundingBox GetMeshBoundingBox(Mesh mesh); + public static extern bool ExportMeshAsCode(Mesh mesh, char8 *fileName); /// Generate heightmap mesh from image data [CLink] @@ -2080,9 +2192,9 @@ public static class Raylib [CLink] public static extern Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); - /// Check if a material is ready + /// Check if a material is valid (shader assigned, map textures loaded in GPU) [CLink] - public static extern bool IsMaterialReady(Material material); + public static extern bool IsMaterialValid(Material material); /// Unload material from GPU memory (VRAM) [CLink] @@ -2092,10 +2204,14 @@ public static class Raylib [CLink] public static extern void SetMaterialTexture(Material *material, int32 mapType, Texture2D texture); - /// Update model animation pose + /// Update model animation pose (CPU) [CLink] public static extern void UpdateModelAnimation(Model model, ModelAnimation anim, int32 frame); + /// Update model animation mesh bone matrices (GPU skinning) + [CLink] + public static extern void UpdateModelAnimationBones(Model model, ModelAnimation anim, int32 frame); + /// Unload animation data [CLink] public static extern void UnloadModelAnimation(ModelAnimation anim); @@ -2136,9 +2252,9 @@ public static class Raylib [CLink] public static extern RayCollision GetRayCollisionQuad(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4); - /// Checks if wave data is ready + /// Checks if wave data is valid (data loaded and parameters) [CLink] - public static extern bool IsWaveReady(Wave wave); + public static extern bool IsWaveValid(Wave wave); /// Load sound from wave data [CLink] @@ -2148,9 +2264,9 @@ public static class Raylib [CLink] public static extern Sound LoadSoundAlias(Sound source); - /// Checks if a sound is ready + /// Checks if a sound is valid (data loaded and buffers initialized) [CLink] - public static extern bool IsSoundReady(Sound sound); + public static extern bool IsSoundValid(Sound sound); /// Update sound buffer with new data [CLink] @@ -2216,9 +2332,9 @@ public static class Raylib [CLink] public static extern float * LoadWaveSamples(Wave wave); - /// Checks if a music stream is ready + /// Checks if a music stream is valid (context and buffers initialized) [CLink] - public static extern bool IsMusicReady(Music music); + public static extern bool IsMusicValid(Music music); /// Unload music stream [CLink] @@ -2272,9 +2388,9 @@ public static class Raylib [CLink] public static extern float GetMusicTimePlayed(Music music); - /// Checks if an audio stream is ready + /// Checks if an audio stream is valid (buffers initialized) [CLink] - public static extern bool IsAudioStreamReady(AudioStream stream); + public static extern bool IsAudioStreamValid(AudioStream stream); /// Unload audio stream and free memory [CLink] @@ -2324,7 +2440,7 @@ public static class Raylib [CLink] public static extern void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); - /// Attach audio stream processor to stream, receives the samples as s + /// Attach audio stream processor to stream, receives the samples as 'float' [CLink] public static extern void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); @@ -2334,7 +2450,7 @@ public static class Raylib #else - /// Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP) + /// Set icon for window (single image, RGBA 32bit) [CLink] public static extern void SetWindowIcon(in Image image); @@ -2370,9 +2486,9 @@ public static class Raylib [CLink] public static extern void UnloadVrStereoConfig(in VrStereoConfig config); - /// Check if a shader is ready + /// Check if a shader is valid (loaded on GPU) [CLink] - public static extern bool IsShaderReady(in Shader shader); + public static extern bool IsShaderValid(in Shader shader); /// Get shader uniform location [CLink] @@ -2402,26 +2518,18 @@ public static class Raylib [CLink] public static extern void UnloadShader(in Shader shader); - /// Get a ray trace from mouse position + /// Get a ray trace from screen position (i.e mouse) [CLink] - public static extern Ray GetMouseRay(in Vector2 mousePosition, in Camera camera); + public static extern Ray GetScreenToWorldRay(in Vector2 position, in Camera camera); - /// Get camera transform matrix (view matrix) + /// Get a ray trace from screen position (i.e mouse) in a viewport [CLink] - public static extern Matrix GetCameraMatrix(in Camera camera); - - /// Get camera 2d transform matrix - [CLink] - public static extern Matrix GetCameraMatrix2D(in Camera2D camera); + public static extern Ray GetScreenToWorldRayEx(in Vector2 position, in Camera camera, int32 width, int32 height); /// Get the screen space position for a 3d world space position [CLink] public static extern Vector2 GetWorldToScreen(in Vector3 position, in Camera camera); - /// Get the world space position for a 2d camera screen space position - [CLink] - public static extern Vector2 GetScreenToWorld2D(in Vector2 position, in Camera2D camera); - /// Get size position for a 3d world space position [CLink] public static extern Vector2 GetWorldToScreenEx(in Vector3 position, in Camera camera, int32 width, int32 height); @@ -2430,6 +2538,18 @@ public static class Raylib [CLink] public static extern Vector2 GetWorldToScreen2D(in Vector2 position, in Camera2D camera); + /// Get the world space position for a 2d camera screen space position + [CLink] + public static extern Vector2 GetScreenToWorld2D(in Vector2 position, in Camera2D camera); + + /// Get camera transform matrix (view matrix) + [CLink] + public static extern Matrix GetCameraMatrix(in Camera camera); + + /// Get camera 2d transform matrix + [CLink] + public static extern Matrix GetCameraMatrix2D(in Camera2D camera); + /// Unload filepaths [CLink] public static extern void UnloadDirectoryFiles(in FilePathList files); @@ -2438,6 +2558,10 @@ public static class Raylib [CLink] public static extern void UnloadDroppedFiles(in FilePathList files); + /// Unload automation events list from file + [CLink] + public static extern void UnloadAutomationEventList(in AutomationEventList list); + /// Export automation events list as text file [CLink] public static extern bool ExportAutomationEventList(in AutomationEventList list, char8 *fileName); @@ -2454,11 +2578,11 @@ public static class Raylib [CLink] public static extern void SetShapesTexture(in Texture2D texture, in Rectangle source); - /// Draw a pixel + /// Draw a pixel using geometry [Can be slow, use with care] [CLink] public static extern void DrawPixel(int32 posX, int32 posY, in Color color); - /// Draw a pixel (Vector version) + /// Draw a pixel using geometry (Vector version) [Can be slow, use with care] [CLink] public static extern void DrawPixelV(in Vector2 position, in Color color); @@ -2496,7 +2620,7 @@ public static class Raylib /// Draw a gradient-filled circle [CLink] - public static extern void DrawCircleGradient(int32 centerX, int32 centerY, float radius, in Color color1, in Color color2); + public static extern void DrawCircleGradient(int32 centerX, int32 centerY, float radius, in Color inner, in Color outer); /// Draw a color-filled circle (Vector version) [CLink] @@ -2544,15 +2668,15 @@ public static class Raylib /// Draw a vertical-gradient-filled rectangle [CLink] - public static extern void DrawRectangleGradientV(int32 posX, int32 posY, int32 width, int32 height, in Color color1, in Color color2); + public static extern void DrawRectangleGradientV(int32 posX, int32 posY, int32 width, int32 height, in Color top, in Color bottom); /// Draw a horizontal-gradient-filled rectangle [CLink] - public static extern void DrawRectangleGradientH(int32 posX, int32 posY, int32 width, int32 height, in Color color1, in Color color2); + public static extern void DrawRectangleGradientH(int32 posX, int32 posY, int32 width, int32 height, in Color left, in Color right); /// Draw a gradient-filled rectangle with custom vertex colors [CLink] - public static extern void DrawRectangleGradientEx(in Rectangle rec, in Color col1, in Color col2, in Color col3, in Color col4); + public static extern void DrawRectangleGradientEx(in Rectangle rec, in Color topLeft, in Color bottomLeft, in Color topRight, in Color bottomRight); /// Draw rectangle outline [CLink] @@ -2566,9 +2690,13 @@ public static class Raylib [CLink] public static extern void DrawRectangleRounded(in Rectangle rec, float roundness, int32 segments, in Color color); + /// Draw rectangle lines with rounded edges + [CLink] + public static extern void DrawRectangleRoundedLines(in Rectangle rec, float roundness, int32 segments, in Color color); + /// Draw rectangle with rounded edges outline [CLink] - public static extern void DrawRectangleRoundedLines(in Rectangle rec, float roundness, int32 segments, float lineThick, in Color color); + public static extern void DrawRectangleRoundedLinesEx(in Rectangle rec, float roundness, int32 segments, float lineThick, in Color color); /// Draw a color-filled triangle (vertex in counter-clockwise order!) [CLink] @@ -2670,6 +2798,10 @@ public static class Raylib [CLink] public static extern bool CheckCollisionCircleRec(in Vector2 center, float radius, in Rectangle rec); + /// Check if circle collides with a line created betweeen two points [p1] and [p2] + [CLink] + public static extern bool CheckCollisionCircleLine(in Vector2 center, float radius, in Vector2 p1, in Vector2 p2); + /// Check if point is inside rectangle [CLink] public static extern bool CheckCollisionPointRec(in Vector2 point, in Rectangle rec); @@ -2682,6 +2814,10 @@ public static class Raylib [CLink] public static extern bool CheckCollisionPointTriangle(in Vector2 point, in Vector2 p1, in Vector2 p2, in Vector2 p3); + /// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] + [CLink] + public static extern bool CheckCollisionPointLine(in Vector2 point, in Vector2 p1, in Vector2 p2, int32 threshold); + /// Check if point is within a polygon described by array of vertices [CLink] public static extern bool CheckCollisionPointPoly(in Vector2 point, Vector2 *points, int32 pointCount); @@ -2690,10 +2826,6 @@ public static class Raylib [CLink] public static extern bool CheckCollisionLines(in Vector2 startPos1, in Vector2 endPos1, in Vector2 startPos2, in Vector2 endPos2, Vector2 *collisionPoint); - /// Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] - [CLink] - public static extern bool CheckCollisionPointLine(in Vector2 point, in Vector2 p1, in Vector2 p2, int32 threshold); - /// Get collision rectangle for two rectangles collision [CLink] public static extern Rectangle GetCollisionRec(in Rectangle rec1, in Rectangle rec2); @@ -2702,9 +2834,9 @@ public static class Raylib [CLink] public static extern Image LoadImageFromTexture(in Texture2D texture); - /// Check if an image is ready + /// Check if an image is valid (data and parameters) [CLink] - public static extern bool IsImageReady(in Image image); + public static extern bool IsImageValid(in Image image); /// Unload image from CPU memory (RAM) [CLink] @@ -2750,6 +2882,10 @@ public static class Raylib [CLink] public static extern Image ImageFromImage(in Image image, in Rectangle rec); + /// Create an image from a selected channel of another image (GRAYSCALE) + [CLink] + public static extern Image ImageFromChannel(in Image image, int32 selectedChannel); + /// Create an image from text (default font) [CLink] public static extern Image ImageText(char8 *text, int32 fontSize, in Color color); @@ -2822,6 +2958,10 @@ public static class Raylib [CLink] public static extern void ImageDrawLineV(Image *dst, in Vector2 start, in Vector2 end, in Color color); + /// Draw a line defining thickness within an image + [CLink] + public static extern void ImageDrawLineEx(Image *dst, in Vector2 start, in Vector2 end, int32 thick, in Color color); + /// Draw a filled circle within an image [CLink] public static extern void ImageDrawCircle(Image *dst, int32 centerX, int32 centerY, int32 radius, in Color color); @@ -2854,6 +2994,26 @@ public static class Raylib [CLink] public static extern void ImageDrawRectangleLines(Image *dst, in Rectangle rec, int32 thick, in Color color); + /// Draw triangle within an image + [CLink] + public static extern void ImageDrawTriangle(Image *dst, in Vector2 v1, in Vector2 v2, in Vector2 v3, in Color color); + + /// Draw triangle with interpolated colors within an image + [CLink] + public static extern void ImageDrawTriangleEx(Image *dst, in Vector2 v1, in Vector2 v2, in Vector2 v3, in Color c1, in Color c2, in Color c3); + + /// Draw triangle outline within an image + [CLink] + public static extern void ImageDrawTriangleLines(Image *dst, in Vector2 v1, in Vector2 v2, in Vector2 v3, in Color color); + + /// Draw a triangle fan defined by points within an image (first vertex is the center) + [CLink] + public static extern void ImageDrawTriangleFan(Image *dst, Vector2 *points, int32 pointCount, in Color color); + + /// Draw a triangle strip defined by points within an image + [CLink] + public static extern void ImageDrawTriangleStrip(Image *dst, Vector2 *points, int32 pointCount, in Color color); + /// Draw a source image within a destination image (tint applied to source) [CLink] public static extern void ImageDraw(Image *dst, in Image src, in Rectangle srcRec, in Rectangle dstRec, in Color tint); @@ -2874,17 +3034,17 @@ public static class Raylib [CLink] public static extern TextureCubemap LoadTextureCubemap(in Image image, int32 layout); - /// Check if a texture is ready + /// Check if a texture is valid (loaded in GPU) [CLink] - public static extern bool IsTextureReady(in Texture2D texture); + public static extern bool IsTextureValid(in Texture2D texture); /// Unload texture from GPU memory (VRAM) [CLink] public static extern void UnloadTexture(in Texture2D texture); - /// Check if a render texture is ready + /// Check if a render texture is valid (loaded in GPU) [CLink] - public static extern bool IsRenderTextureReady(in RenderTexture2D target); + public static extern bool IsRenderTextureValid(in RenderTexture2D target); /// Unload render texture from GPU memory (VRAM) [CLink] @@ -2930,11 +3090,15 @@ public static class Raylib [CLink] public static extern void DrawTextureNPatch(in Texture2D texture, in NPatchInfo nPatchInfo, in Rectangle dest, in Vector2 origin, float rotation, in Color tint); + /// Check if two colors are equal + [CLink] + public static extern bool ColorIsEqual(in Color col1, in Color col2); + /// Get color with alpha applied, alpha goes from 0.0f to 1.0f [CLink] public static extern Color Fade(in Color color, float alpha); - /// Get hexadecimal value for a Color + /// Get hexadecimal value for a Color (0xRRGGBBAA) [CLink] public static extern int32 ColorToInt(in Color color); @@ -2970,6 +3134,10 @@ public static class Raylib [CLink] public static extern Color ColorAlphaBlend(in Color dst, in Color src, in Color tint); + /// Get color lerp interpolation between two colors, factor [0.0f..1.0f] + [CLink] + public static extern Color ColorLerp(in Color color1, in Color color2, float factor); + /// Set color formatted into destination pixel pointer [CLink] public static extern void SetPixelColor(void *dstPtr, in Color color, int32 format); @@ -2978,9 +3146,9 @@ public static class Raylib [CLink] public static extern Font LoadFontFromImage(in Image image, in Color key, int32 firstChar); - /// Check if a font is ready + /// Check if a font is valid (font data loaded, WARNING: GPU texture not checked) [CLink] - public static extern bool IsFontReady(in Font font); + public static extern bool IsFontValid(in Font font); /// Unload font from GPU memory (VRAM) [CLink] @@ -3110,9 +3278,9 @@ public static class Raylib [CLink] public static extern Model LoadModelFromMesh(in Mesh mesh); - /// Check if a model is ready + /// Check if a model is valid (loaded in GPU, VAO/VBOs) [CLink] - public static extern bool IsModelReady(in Model model); + public static extern bool IsModelValid(in Model model); /// Unload model (including meshes) from memory (RAM and/or VRAM) [CLink] @@ -3138,13 +3306,21 @@ public static class Raylib [CLink] public static extern void DrawModelWiresEx(in Model model, in Vector3 position, in Vector3 rotationAxis, float rotationAngle, in Vector3 scale, in Color tint); + /// Draw a model as points + [CLink] + public static extern void DrawModelPoints(in Model model, in Vector3 position, float scale, in Color tint); + + /// Draw a model as points with extended parameters + [CLink] + public static extern void DrawModelPointsEx(in Model model, in Vector3 position, in Vector3 rotationAxis, float rotationAngle, in Vector3 scale, in Color tint); + /// Draw bounding box (wires) [CLink] public static extern void DrawBoundingBox(in BoundingBox @box, in Color color); /// Draw a billboard texture [CLink] - public static extern void DrawBillboard(in Camera camera, in Texture2D texture, in Vector3 position, float size, in Color tint); + public static extern void DrawBillboard(in Camera camera, in Texture2D texture, in Vector3 position, float scale, in Color tint); /// Draw a billboard texture defined by source [CLink] @@ -3170,13 +3346,17 @@ public static class Raylib [CLink] public static extern void DrawMeshInstanced(in Mesh mesh, in Material material, Matrix *transforms, int32 instances); + /// Compute mesh bounding box limits + [CLink] + public static extern BoundingBox GetMeshBoundingBox(in Mesh mesh); + /// Export mesh data to file, returns true on success [CLink] public static extern bool ExportMesh(in Mesh mesh, char8 *fileName); - /// Compute mesh bounding box limits + /// Export mesh as code file (.h) defining multiple arrays of vertex attributes [CLink] - public static extern BoundingBox GetMeshBoundingBox(in Mesh mesh); + public static extern bool ExportMeshAsCode(in Mesh mesh, char8 *fileName); /// Generate heightmap mesh from image data [CLink] @@ -3186,9 +3366,9 @@ public static class Raylib [CLink] public static extern Mesh GenMeshCubicmap(in Image cubicmap, in Vector3 cubeSize); - /// Check if a material is ready + /// Check if a material is valid (shader assigned, map textures loaded in GPU) [CLink] - public static extern bool IsMaterialReady(in Material material); + public static extern bool IsMaterialValid(in Material material); /// Unload material from GPU memory (VRAM) [CLink] @@ -3198,10 +3378,14 @@ public static class Raylib [CLink] public static extern void SetMaterialTexture(Material *material, int32 mapType, in Texture2D texture); - /// Update model animation pose + /// Update model animation pose (CPU) [CLink] public static extern void UpdateModelAnimation(in Model model, in ModelAnimation anim, int32 frame); + /// Update model animation mesh bone matrices (GPU skinning) + [CLink] + public static extern void UpdateModelAnimationBones(in Model model, in ModelAnimation anim, int32 frame); + /// Unload animation data [CLink] public static extern void UnloadModelAnimation(in ModelAnimation anim); @@ -3242,9 +3426,9 @@ public static class Raylib [CLink] public static extern RayCollision GetRayCollisionQuad(in Ray ray, in Vector3 p1, in Vector3 p2, in Vector3 p3, in Vector3 p4); - /// Checks if wave data is ready + /// Checks if wave data is valid (data loaded and parameters) [CLink] - public static extern bool IsWaveReady(in Wave wave); + public static extern bool IsWaveValid(in Wave wave); /// Load sound from wave data [CLink] @@ -3254,9 +3438,9 @@ public static class Raylib [CLink] public static extern Sound LoadSoundAlias(in Sound source); - /// Checks if a sound is ready + /// Checks if a sound is valid (data loaded and buffers initialized) [CLink] - public static extern bool IsSoundReady(in Sound sound); + public static extern bool IsSoundValid(in Sound sound); /// Update sound buffer with new data [CLink] @@ -3322,9 +3506,9 @@ public static class Raylib [CLink] public static extern float * LoadWaveSamples(in Wave wave); - /// Checks if a music stream is ready + /// Checks if a music stream is valid (context and buffers initialized) [CLink] - public static extern bool IsMusicReady(in Music music); + public static extern bool IsMusicValid(in Music music); /// Unload music stream [CLink] @@ -3378,9 +3562,9 @@ public static class Raylib [CLink] public static extern float GetMusicTimePlayed(in Music music); - /// Checks if an audio stream is ready + /// Checks if an audio stream is valid (buffers initialized) [CLink] - public static extern bool IsAudioStreamReady(in AudioStream stream); + public static extern bool IsAudioStreamValid(in AudioStream stream); /// Unload audio stream and free memory [CLink] @@ -3430,7 +3614,7 @@ public static class Raylib [CLink] public static extern void SetAudioStreamCallback(in AudioStream stream, AudioCallback callback); - /// Attach audio stream processor to stream, receives the samples as s + /// Attach audio stream processor to stream, receives the samples as 'float' [CLink] public static extern void AttachAudioStreamProcessor(in AudioStream stream, AudioCallback processor); diff --git a/raylib-beef/src/Raymath.bf b/raylib-beef/src/Raymath.bf index 804321b..88292ee 100644 --- a/raylib-beef/src/Raymath.bf +++ b/raylib-beef/src/Raymath.bf @@ -65,6 +65,14 @@ public static class Raymath [CLink] public static extern void Vector3OrthoNormalize(Vector3 *v1, Vector3 *v2); + /// + [CLink] + public static extern Vector4 Vector4Zero(); + + /// + [CLink] + public static extern Vector4 Vector4One(); + /// [CLink] public static extern Matrix MatrixIdentity(); @@ -91,7 +99,7 @@ public static class Raymath /// [CLink] - public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far); + public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double nearPlane, double farPlane); /// [CLink] @@ -187,6 +195,14 @@ public static class Raymath [CLink] public static extern Vector2 Vector2Reflect(Vector2 v, Vector2 normal); + /// + [CLink] + public static extern Vector2 Vector2Min(Vector2 v1, Vector2 v2); + + /// + [CLink] + public static extern Vector2 Vector2Max(Vector2 v1, Vector2 v2); + /// [CLink] public static extern Vector2 Vector2Rotate(Vector2 v, float angle); @@ -211,6 +227,10 @@ public static class Raymath [CLink] public static extern int32 Vector2Equals(Vector2 p, Vector2 q); + /// + [CLink] + public static extern Vector2 Vector2Refract(Vector2 v, Vector2 n, float r); + /// [CLink] public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2); @@ -291,10 +311,18 @@ public static class Raymath [CLink] public static extern Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle); + /// + [CLink] + public static extern Vector3 Vector3MoveTowards(Vector3 v, Vector3 target, float maxDistance); + /// [CLink] public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount); + /// + [CLink] + public static extern Vector3 Vector3CubicHermite(Vector3 v1, Vector3 tangent1, Vector3 v2, Vector3 tangent2, float amount); + /// [CLink] public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal); @@ -339,6 +367,86 @@ public static class Raymath [CLink] public static extern Vector3 Vector3Refract(Vector3 v, Vector3 n, float r); + /// + [CLink] + public static extern Vector4 Vector4Add(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4AddValue(Vector4 v, float add); + + /// + [CLink] + public static extern Vector4 Vector4Subtract(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4SubtractValue(Vector4 v, float add); + + /// + [CLink] + public static extern float Vector4Length(Vector4 v); + + /// + [CLink] + public static extern float Vector4LengthSqr(Vector4 v); + + /// + [CLink] + public static extern float Vector4DotProduct(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern float Vector4Distance(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern float Vector4DistanceSqr(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Scale(Vector4 v, float scale); + + /// + [CLink] + public static extern Vector4 Vector4Multiply(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Negate(Vector4 v); + + /// + [CLink] + public static extern Vector4 Vector4Divide(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Normalize(Vector4 v); + + /// + [CLink] + public static extern Vector4 Vector4Min(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Max(Vector4 v1, Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Lerp(Vector4 v1, Vector4 v2, float amount); + + /// + [CLink] + public static extern Vector4 Vector4MoveTowards(Vector4 v, Vector4 target, float maxDistance); + + /// + [CLink] + public static extern Vector4 Vector4Invert(Vector4 v); + + /// + [CLink] + public static extern int32 Vector4Equals(Vector4 p, Vector4 q); + /// [CLink] public static extern float MatrixDeterminant(Matrix mat); @@ -439,6 +547,10 @@ public static class Raymath [CLink] public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount); + /// + [CLink] + public static extern Quaternion QuaternionCubicHermiteSpline(Quaternion q1, Quaternion outTangent1, Quaternion q2, Quaternion inTangent2, float t); + /// [CLink] public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to); @@ -471,6 +583,10 @@ public static class Raymath [CLink] public static extern int32 QuaternionEquals(Quaternion p, Quaternion q); + /// + [CLink] + public static extern void MatrixDecompose(Matrix mat, Vector3 *translation, Quaternion *rotation, Vector3 *scale); + #else /// @@ -549,6 +665,14 @@ public static class Raymath [CLink] public static extern Vector2 Vector2Reflect(in Vector2 v, in Vector2 normal); + /// + [CLink] + public static extern Vector2 Vector2Min(in Vector2 v1, in Vector2 v2); + + /// + [CLink] + public static extern Vector2 Vector2Max(in Vector2 v1, in Vector2 v2); + /// [CLink] public static extern Vector2 Vector2Rotate(in Vector2 v, float angle); @@ -573,6 +697,10 @@ public static class Raymath [CLink] public static extern int32 Vector2Equals(in Vector2 p, in Vector2 q); + /// + [CLink] + public static extern Vector2 Vector2Refract(in Vector2 v, in Vector2 n, float r); + /// [CLink] public static extern Vector3 Vector3Add(in Vector3 v1, in Vector3 v2); @@ -653,10 +781,18 @@ public static class Raymath [CLink] public static extern Vector3 Vector3RotateByAxisAngle(in Vector3 v, in Vector3 axis, float angle); + /// + [CLink] + public static extern Vector3 Vector3MoveTowards(in Vector3 v, in Vector3 target, float maxDistance); + /// [CLink] public static extern Vector3 Vector3Lerp(in Vector3 v1, in Vector3 v2, float amount); + /// + [CLink] + public static extern Vector3 Vector3CubicHermite(in Vector3 v1, in Vector3 tangent1, in Vector3 v2, in Vector3 tangent2, float amount); + /// [CLink] public static extern Vector3 Vector3Reflect(in Vector3 v, in Vector3 normal); @@ -701,6 +837,86 @@ public static class Raymath [CLink] public static extern Vector3 Vector3Refract(in Vector3 v, in Vector3 n, float r); + /// + [CLink] + public static extern Vector4 Vector4Add(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4AddValue(in Vector4 v, float add); + + /// + [CLink] + public static extern Vector4 Vector4Subtract(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4SubtractValue(in Vector4 v, float add); + + /// + [CLink] + public static extern float Vector4Length(in Vector4 v); + + /// + [CLink] + public static extern float Vector4LengthSqr(in Vector4 v); + + /// + [CLink] + public static extern float Vector4DotProduct(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern float Vector4Distance(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern float Vector4DistanceSqr(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Scale(in Vector4 v, float scale); + + /// + [CLink] + public static extern Vector4 Vector4Multiply(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Negate(in Vector4 v); + + /// + [CLink] + public static extern Vector4 Vector4Divide(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Normalize(in Vector4 v); + + /// + [CLink] + public static extern Vector4 Vector4Min(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Max(in Vector4 v1, in Vector4 v2); + + /// + [CLink] + public static extern Vector4 Vector4Lerp(in Vector4 v1, in Vector4 v2, float amount); + + /// + [CLink] + public static extern Vector4 Vector4MoveTowards(in Vector4 v, in Vector4 target, float maxDistance); + + /// + [CLink] + public static extern Vector4 Vector4Invert(in Vector4 v); + + /// + [CLink] + public static extern int32 Vector4Equals(in Vector4 p, in Vector4 q); + /// [CLink] public static extern float MatrixDeterminant(in Matrix mat); @@ -801,6 +1017,10 @@ public static class Raymath [CLink] public static extern Quaternion QuaternionSlerp(in Quaternion q1, in Quaternion q2, float amount); + /// + [CLink] + public static extern Quaternion QuaternionCubicHermiteSpline(in Quaternion q1, in Quaternion outTangent1, in Quaternion q2, in Quaternion inTangent2, float t); + /// [CLink] public static extern Quaternion QuaternionFromVector3ToVector3(in Vector3 from, in Vector3 to); @@ -833,6 +1053,10 @@ public static class Raymath [CLink] public static extern int32 QuaternionEquals(in Quaternion p, in Quaternion q); + /// + [CLink] + public static extern void MatrixDecompose(in Matrix mat, Vector3 *translation, Quaternion *rotation, Vector3 *scale); + #endif } diff --git a/raylib-beef/src/Rlgl.bf b/raylib-beef/src/Rlgl.bf index 5aafda3..1688c15 100644 --- a/raylib-beef/src/Rlgl.bf +++ b/raylib-beef/src/Rlgl.bf @@ -5,7 +5,7 @@ namespace RaylibBeef; public static class Rlgl { - public const char8* RLGL_VERSION = "4.5"; + public const char8* RLGL_VERSION = "5.0"; public const int32 RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192; @@ -222,6 +222,30 @@ public static class Rlgl /// GL_BLEND_COLOR public const int32 RL_BLEND_COLOR = 32773; + /// GL_READ_FRAMEBUFFER + public const int32 RL_READ_FRAMEBUFFER = 36008; + + /// GL_DRAW_FRAMEBUFFER + public const int32 RL_DRAW_FRAMEBUFFER = 36009; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION = 0; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD = 1; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL = 2; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR = 3; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT = 4; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 = 5; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES = 6; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS = 7; + + public const int32 RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS = 8; + /// Choose the current matrix to be transformed [CLink] public static extern void rlMatrixMode(int32 mode); @@ -266,6 +290,18 @@ public static class Rlgl [CLink] public static extern void rlViewport(int32 x, int32 y, int32 width, int32 height); + /// Set clip planes distances + [CLink] + public static extern void rlSetClipPlanes(double nearPlane, double farPlane); + + /// Get cull plane distance near + [CLink] + public static extern double rlGetCullDistanceNear(); + + /// Get cull plane distance far + [CLink] + public static extern double rlGetCullDistanceFar(); + /// Initialize drawing mode (how to organize vertex) [CLink] public static extern void rlBegin(int32 mode); @@ -390,6 +426,10 @@ public static class Rlgl [CLink] public static extern void rlDisableFramebuffer(); + /// Get the currently active render texture (fbo), 0 for default framebuffer + [CLink] + public static extern int32 rlGetActiveFramebuffer(); + /// Activate multiple draw color buffers [CLink] public static extern void rlActiveDrawBuffers(int32 count); @@ -398,6 +438,10 @@ public static class Rlgl [CLink] public static extern void rlBlitFramebuffer(int32 srcX, int32 srcY, int32 srcWidth, int32 srcHeight, int32 dstX, int32 dstY, int32 dstWidth, int32 dstHeight, int32 bufferMask); + /// Bind framebuffer (FBO) + [CLink] + public static extern void rlBindFramebuffer(int32 target, int32 framebuffer); + /// Enable color blending [CLink] public static extern void rlEnableColorBlend(); @@ -430,6 +474,10 @@ public static class Rlgl [CLink] public static extern void rlDisableBackfaceCulling(); + /// Color mask control + [CLink] + public static extern void rlColorMask(bool r, bool g, bool b, bool a); + /// Set face culling mode [CLink] public static extern void rlSetCullFace(int32 mode); @@ -454,7 +502,7 @@ public static class Rlgl [CLink] public static extern void rlEnablePointMode(); - /// Disable wire mode ( and point ) maybe rename + /// Disable wire (and point) mode [CLink] public static extern void rlDisableWireMode(); @@ -582,59 +630,59 @@ public static class Rlgl [CLink] public static extern int32 rlLoadVertexArray(); - /// Load a vertex buffer attribute + /// Load a vertex buffer object [CLink] public static extern int32 rlLoadVertexBuffer(void *buffer, int32 size, bool dynamic); - /// Load a new attributes element buffer + /// Load vertex buffer elements object [CLink] public static extern int32 rlLoadVertexBufferElement(void *buffer, int32 size, bool dynamic); - /// Update GPU buffer with new data + /// Update vertex buffer object data on GPU buffer [CLink] public static extern void rlUpdateVertexBuffer(int32 bufferId, void *data, int32 dataSize, int32 offset); - /// Update vertex buffer elements with new data + /// Update vertex buffer elements data on GPU buffer [CLink] public static extern void rlUpdateVertexBufferElements(int32 id, void *data, int32 dataSize, int32 offset); - /// + /// Unload vertex array (vao) [CLink] public static extern void rlUnloadVertexArray(int32 vaoId); - /// + /// Unload vertex buffer object [CLink] public static extern void rlUnloadVertexBuffer(int32 vboId); - /// + /// Set vertex attribute data configuration [CLink] - public static extern void rlSetVertexAttribute(int32 index, int32 compSize, int32 type, bool normalized, int32 stride, void *pointer); + public static extern void rlSetVertexAttribute(int32 index, int32 compSize, int32 type, bool normalized, int32 stride, int32 offset); - /// + /// Set vertex attribute data divisor [CLink] public static extern void rlSetVertexAttributeDivisor(int32 index, int32 divisor); - /// Set vertex attribute default value + /// Set vertex attribute default value, when attribute to provided [CLink] public static extern void rlSetVertexAttributeDefault(int32 locIndex, void *value, int32 attribType, int32 count); - /// + /// Draw vertex array (currently active vao) [CLink] public static extern void rlDrawVertexArray(int32 offset, int32 count); - /// + /// Draw vertex array elements [CLink] public static extern void rlDrawVertexArrayElements(int32 offset, int32 count, void *buffer); - /// + /// Draw vertex array (currently active vao) with instancing [CLink] public static extern void rlDrawVertexArrayInstanced(int32 offset, int32 count, int32 instances); - /// + /// Draw vertex array elements with instancing [CLink] public static extern void rlDrawVertexArrayElementsInstanced(int32 offset, int32 count, void *buffer, int32 instances); - /// Load texture in GPU + /// Load texture data [CLink] public static extern int32 rlLoadTexture(void *data, int32 width, int32 height, int32 format, int32 mipmapCount); @@ -642,11 +690,11 @@ public static class Rlgl [CLink] public static extern int32 rlLoadTextureDepth(int32 width, int32 height, bool useRenderBuffer); - /// Load texture cubemap + /// Load texture cubemap data [CLink] - public static extern int32 rlLoadTextureCubemap(void *data, int32 size, int32 format); + public static extern int32 rlLoadTextureCubemap(void *data, int32 size, int32 format, int32 mipmapCount); - /// Update GPU texture with new data + /// Update texture with new data on GPU [CLink] public static extern void rlUpdateTexture(int32 id, int32 offsetX, int32 offsetY, int32 width, int32 height, int32 format, void *data); @@ -676,7 +724,7 @@ public static class Rlgl /// Load an empty framebuffer [CLink] - public static extern int32 rlLoadFramebuffer(int32 width, int32 height); + public static extern int32 rlLoadFramebuffer(); /// Attach texture/renderbuffer to a framebuffer [CLink] @@ -718,6 +766,10 @@ public static class Rlgl [CLink] public static extern void rlSetUniform(int32 locIndex, void *value, int32 uniformType, int32 count); + /// Set shader value matrices + [CLink] + public static extern void rlSetUniformMatrices(int32 locIndex, Matrix *mat, int32 count); + /// Set shader value sampler [CLink] public static extern void rlSetUniformSampler(int32 locIndex, int32 textureId); diff --git a/raylib-beef/src/ShaderLocationIndex.bf b/raylib-beef/src/ShaderLocationIndex.bf index 45b9d62..c6d4a3a 100644 --- a/raylib-beef/src/ShaderLocationIndex.bf +++ b/raylib-beef/src/ShaderLocationIndex.bf @@ -59,6 +59,12 @@ public enum ShaderLocationIndex : c_int case SHADER_LOC_MAP_PREFILTER = 24; /// Shader location: sampler2d texture: brdf case SHADER_LOC_MAP_BRDF = 25; + /// Shader location: vertex attribute: boneIds + case SHADER_LOC_VERTEX_BONEIDS = 26; + /// Shader location: vertex attribute: boneWeights + case SHADER_LOC_VERTEX_BONEWEIGHTS = 27; + /// Shader location: array of matrices uniform: boneMatrices + case SHADER_LOC_BONE_MATRICES = 28; public static operator int32 (ShaderLocationIndex self) => (int32)self; } diff --git a/raylib-beef/src/VrDeviceInfo.bf b/raylib-beef/src/VrDeviceInfo.bf index dd94b17..dcc648e 100644 --- a/raylib-beef/src/VrDeviceInfo.bf +++ b/raylib-beef/src/VrDeviceInfo.bf @@ -18,9 +18,6 @@ public struct VrDeviceInfo /// Vertical size in meters public float vScreenSize; - /// Screen center in meters - public float vScreenCenter; - /// Distance between eye and display in meters public float eyeToScreenDistance; @@ -36,13 +33,12 @@ public struct VrDeviceInfo /// Chromatic aberration correction parameters public float[4] chromaAbCorrection; - public this(int32 hResolution, int32 vResolution, float hScreenSize, float vScreenSize, float vScreenCenter, float eyeToScreenDistance, float lensSeparationDistance, float interpupillaryDistance, float[4] lensDistortionValues, float[4] chromaAbCorrection) + public this(int32 hResolution, int32 vResolution, float hScreenSize, float vScreenSize, float eyeToScreenDistance, float lensSeparationDistance, float interpupillaryDistance, float[4] lensDistortionValues, float[4] chromaAbCorrection) { this.hResolution = hResolution; this.vResolution = vResolution; this.hScreenSize = hScreenSize; this.vScreenSize = vScreenSize; - this.vScreenCenter = vScreenCenter; this.eyeToScreenDistance = eyeToScreenDistance; this.lensSeparationDistance = lensSeparationDistance; this.interpupillaryDistance = interpupillaryDistance; diff --git a/raylib-beef/src/rlShaderUniformDataType.bf b/raylib-beef/src/rlShaderUniformDataType.bf index 780ee00..a40fd6d 100644 --- a/raylib-beef/src/rlShaderUniformDataType.bf +++ b/raylib-beef/src/rlShaderUniformDataType.bf @@ -23,8 +23,16 @@ public enum rlShaderUniformDataType : c_int case RL_SHADER_UNIFORM_IVEC3 = 6; /// Shader uniform type: ivec4 (4 int) case RL_SHADER_UNIFORM_IVEC4 = 7; + /// Shader uniform type: unsigned int + case RL_SHADER_UNIFORM_UINT = 8; + /// Shader uniform type: uivec2 (2 unsigned int) + case RL_SHADER_UNIFORM_UIVEC2 = 9; + /// Shader uniform type: uivec3 (3 unsigned int) + case RL_SHADER_UNIFORM_UIVEC3 = 10; + /// Shader uniform type: uivec4 (4 unsigned int) + case RL_SHADER_UNIFORM_UIVEC4 = 11; /// Shader uniform type: sampler2d - case RL_SHADER_UNIFORM_SAMPLER2D = 8; + case RL_SHADER_UNIFORM_SAMPLER2D = 12; public static operator int32 (rlShaderUniformDataType self) => (int32)self; } diff --git a/raylib-beef/src/rlVertexBuffer.bf b/raylib-beef/src/rlVertexBuffer.bf index 3b9bfa9..d8f772e 100644 --- a/raylib-beef/src/rlVertexBuffer.bf +++ b/raylib-beef/src/rlVertexBuffer.bf @@ -15,6 +15,9 @@ public struct rlVertexBuffer /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) public void* texcoords; + /// Vertex normal (XYZ - 3 components per vertex) (shader-location = 2) + public void* normals; + /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) public void* colors; @@ -24,14 +27,15 @@ public struct rlVertexBuffer /// OpenGL Vertex Array Object id public void* vaoId; - /// OpenGL Vertex Buffer Objects id (4 types of vertex data) - public int32[4] vboId; + /// OpenGL Vertex Buffer Objects id (5 types of vertex data) + public int32[5] vboId; - public this(int32 elementCount, void* vertices, void* texcoords, void* colors, void* indices, void* vaoId, int32[4] vboId) + public this(int32 elementCount, void* vertices, void* texcoords, void* normals, void* colors, void* indices, void* vaoId, int32[5] vboId) { this.elementCount = elementCount; this.vertices = vertices; this.texcoords = texcoords; + this.normals = normals; this.colors = colors; this.indices = indices; this.vaoId = vaoId;