upgrade to 5.0

This commit is contained in:
Booklordofthedings 2023-11-18 18:29:19 +01:00
parent 9bef8e81dc
commit ae0278d008
16 changed files with 609 additions and 550 deletions

View file

@ -13,7 +13,7 @@ namespace RaylibBeefGenerator
// Current Output Beef Code // Current Output Beef Code
private static StringBuilder OutputString = new StringBuilder(); private static StringBuilder OutputString = new StringBuilder();
private static string OutputDir = @"C:\Dev\raylib-beef\raylib-beef\src\"; private static string OutputDir = @"C:\Share\Game\dependencies\raylib-beef\raylib-beef\src\";
private static Dictionary<string, FileDefinition> jsonFiles = new() private static Dictionary<string, FileDefinition> jsonFiles = new()
{ {
@ -45,7 +45,7 @@ namespace RaylibBeefGenerator
for (var i = 0; i < jsonFiles.Count; i++) for (var i = 0; i < jsonFiles.Count; i++)
{ {
ConvertFile(jsonFiles.ElementAt(i).Value, @$"C:\Dev\raylib-beef\raylib-api\{jsonFiles.ElementAt(i).Key}"); ConvertFile(jsonFiles.ElementAt(i).Value, @$"C:\Share\Game\dependencies\raylib-beef\raylib-api\{jsonFiles.ElementAt(i).Key}");
} }
Console.WriteLine("Successfully Generated Bindings!"); Console.WriteLine("Successfully Generated Bindings!");

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,24 @@
using System;
using System.Interop;
namespace RaylibBeef;
[CRepr]
public struct AutomationEvent
{
/// Event frame
public int32 frame;
/// Event type (AutomationEventType)
public int32 type;
/// Event parameters (if required)
public int32[4] @params;
public this(int32 frame, int32 type, int32[4] @params)
{
this.frame = frame;
this.type = type;
this.@params = @params;
}
}

View file

@ -0,0 +1,24 @@
using System;
using System.Interop;
namespace RaylibBeef;
[CRepr]
public struct AutomationEventList
{
/// Events max entries (MAX_AUTOMATION_EVENTS)
public int32 capacity;
/// Events entries count
public int32 count;
/// Events entries
public AutomationEvent * events;
public this(int32 capacity, int32 count, AutomationEvent * events)
{
this.capacity = capacity;
this.count = count;
this.events = events;
}
}

View file

@ -32,6 +32,8 @@ public enum ConfigFlags : c_int
FLAG_WINDOW_HIGHDPI = 8192, FLAG_WINDOW_HIGHDPI = 8192,
/// Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED /// Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384, FLAG_WINDOW_MOUSE_PASSTHROUGH = 16384,
/// Set to run program in borderless windowed mode
FLAG_BORDERLESS_WINDOWED_MODE = 32768,
/// Set to try enabling MSAA 4X /// Set to try enabling MSAA 4X
FLAG_MSAA_4X_HINT = 32, FLAG_MSAA_4X_HINT = 32,
/// Set to try enabling interlaced video format (for V3D) /// Set to try enabling interlaced video format (for V3D)

View file

@ -18,11 +18,15 @@ public struct ModelAnimation
/// Poses array by frame /// Poses array by frame
public Transform ** framePoses; public Transform ** framePoses;
public this(int32 boneCount, int32 frameCount, BoneInfo * bones, Transform ** framePoses) /// Animation name
public char8[32] name;
public this(int32 boneCount, int32 frameCount, BoneInfo * bones, Transform ** framePoses, char8[32] name)
{ {
this.boneCount = boneCount; this.boneCount = boneCount;
this.frameCount = frameCount; this.frameCount = frameCount;
this.bones = bones; this.bones = bones;
this.framePoses = framePoses; this.framePoses = framePoses;
this.name = name;
} }
} }

View file

@ -26,26 +26,32 @@ public enum PixelFormat : c_int
PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9, PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9,
/// 32*4 bpp (4 channels - float) /// 32*4 bpp (4 channels - float)
PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10, PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10,
/// 16 bpp (1 channel - half float)
PIXELFORMAT_UNCOMPRESSED_R16 = 11,
/// 16*3 bpp (3 channels - half float)
PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12,
/// 16*4 bpp (4 channels - half float)
PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13,
/// 4 bpp (no alpha) /// 4 bpp (no alpha)
PIXELFORMAT_COMPRESSED_DXT1_RGB = 11, PIXELFORMAT_COMPRESSED_DXT1_RGB = 14,
/// 4 bpp (1 bit alpha) /// 4 bpp (1 bit alpha)
PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12, PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15,
/// 8 bpp /// 8 bpp
PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13, PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16,
/// 8 bpp /// 8 bpp
PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14, PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17,
/// 4 bpp /// 4 bpp
PIXELFORMAT_COMPRESSED_ETC1_RGB = 15, PIXELFORMAT_COMPRESSED_ETC1_RGB = 18,
/// 4 bpp /// 4 bpp
PIXELFORMAT_COMPRESSED_ETC2_RGB = 16, PIXELFORMAT_COMPRESSED_ETC2_RGB = 19,
/// 8 bpp /// 8 bpp
PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17, PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20,
/// 4 bpp /// 4 bpp
PIXELFORMAT_COMPRESSED_PVRT_RGB = 18, PIXELFORMAT_COMPRESSED_PVRT_RGB = 21,
/// 4 bpp /// 4 bpp
PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19, PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22,
/// 8 bpp /// 8 bpp
PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20, PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23,
/// 2 bpp /// 2 bpp
PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21, PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24,
} }

View file

@ -5,13 +5,13 @@ namespace RaylibBeef;
public static class Raylib public static class Raylib
{ {
public const int32 RAYLIB_VERSION_MAJOR = 4; public const int32 RAYLIB_VERSION_MAJOR = 5;
public const int32 RAYLIB_VERSION_MINOR = 5; public const int32 RAYLIB_VERSION_MINOR = 0;
public const int32 RAYLIB_VERSION_PATCH = 0; public const int32 RAYLIB_VERSION_PATCH = 0;
public const char8* RAYLIB_VERSION = "4.5"; public const char8* RAYLIB_VERSION = "5.0";
public const float PI = 3.141592653589793f; public const float PI = 3.141592653589793f;
@ -101,14 +101,14 @@ public static class Raylib
[CLink] [CLink]
public static extern void InitWindow(int32 width, int32 height, char8 * title); public static extern void InitWindow(int32 width, int32 height, char8 * title);
/// Check if KEY_ESCAPE pressed or Close icon pressed
[CLink]
public static extern bool WindowShouldClose();
/// Close window and unload OpenGL context /// Close window and unload OpenGL context
[CLink] [CLink]
public static extern void CloseWindow(); public static extern void CloseWindow();
/// Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
[CLink]
public static extern bool WindowShouldClose();
/// Check if window has been initialized successfully /// Check if window has been initialized successfully
[CLink] [CLink]
public static extern bool IsWindowReady(); public static extern bool IsWindowReady();
@ -153,6 +153,10 @@ public static class Raylib
[CLink] [CLink]
public static extern void ToggleFullscreen(); public static extern void ToggleFullscreen();
/// Toggle window state: borderless windowed (only PLATFORM_DESKTOP)
[CLink]
public static extern void ToggleBorderlessWindowed();
/// Set window state: maximized, if resizable (only PLATFORM_DESKTOP) /// Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
[CLink] [CLink]
public static extern void MaximizeWindow(); public static extern void MaximizeWindow();
@ -173,7 +177,7 @@ public static class Raylib
[CLink] [CLink]
public static extern void SetWindowIcons(Image * images, int32 count); public static extern void SetWindowIcons(Image * images, int32 count);
/// Set title for window (only PLATFORM_DESKTOP) /// Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)
[CLink] [CLink]
public static extern void SetWindowTitle(char8 * title); public static extern void SetWindowTitle(char8 * title);
@ -181,7 +185,7 @@ public static class Raylib
[CLink] [CLink]
public static extern void SetWindowPosition(int32 x, int32 y); public static extern void SetWindowPosition(int32 x, int32 y);
/// Set monitor for the current window (fullscreen mode) /// Set monitor for the current window
[CLink] [CLink]
public static extern void SetWindowMonitor(int32 monitor); public static extern void SetWindowMonitor(int32 monitor);
@ -189,6 +193,10 @@ public static class Raylib
[CLink] [CLink]
public static extern void SetWindowMinSize(int32 width, int32 height); public static extern void SetWindowMinSize(int32 width, int32 height);
/// Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
[CLink]
public static extern void SetWindowMaxSize(int32 width, int32 height);
/// Set window dimensions /// Set window dimensions
[CLink] [CLink]
public static extern void SetWindowSize(int32 width, int32 height); public static extern void SetWindowSize(int32 width, int32 height);
@ -197,6 +205,10 @@ public static class Raylib
[CLink] [CLink]
public static extern void SetWindowOpacity(float opacity); public static extern void SetWindowOpacity(float opacity);
/// Set window focused (only PLATFORM_DESKTOP)
[CLink]
public static extern void SetWindowFocused();
/// Get native window handle /// Get native window handle
[CLink] [CLink]
public static extern void * GetWindowHandle(); public static extern void * GetWindowHandle();
@ -257,7 +269,7 @@ public static class Raylib
[CLink] [CLink]
public static extern Vector2 GetWindowScaleDPI(); public static extern Vector2 GetWindowScaleDPI();
/// Get the human-readable, UTF-8 encoded name of the primary monitor /// Get the human-readable, UTF-8 encoded name of the specified monitor
[CLink] [CLink]
public static extern char8 * GetMonitorName(int32 monitor); public static extern char8 * GetMonitorName(int32 monitor);
@ -277,18 +289,6 @@ public static class Raylib
[CLink] [CLink]
public static extern void DisableEventWaiting(); public static extern void DisableEventWaiting();
/// Swap back buffer with front buffer (screen drawing)
[CLink]
public static extern void SwapScreenBuffer();
/// Register all input events
[CLink]
public static extern void PollInputEvents();
/// Wait for some time (halt program execution)
[CLink]
public static extern void WaitTime(double seconds);
/// Shows cursor /// Shows cursor
[CLink] [CLink]
public static extern void ShowCursor(); public static extern void ShowCursor();
@ -461,10 +461,6 @@ public static class Raylib
[CLink] [CLink]
public static extern void SetTargetFPS(int32 fps); public static extern void SetTargetFPS(int32 fps);
/// Get current FPS
[CLink]
public static extern int32 GetFPS();
/// Get time in seconds for last frame drawn (delta time) /// Get time in seconds for last frame drawn (delta time)
[CLink] [CLink]
public static extern float GetFrameTime(); public static extern float GetFrameTime();
@ -473,14 +469,38 @@ public static class Raylib
[CLink] [CLink]
public static extern double GetTime(); public static extern double GetTime();
/// Get a random value between min and max (both included) /// Get current FPS
[CLink] [CLink]
public static extern int32 GetRandomValue(int32 min, int32 max); public static extern int32 GetFPS();
/// Swap back buffer with front buffer (screen drawing)
[CLink]
public static extern void SwapScreenBuffer();
/// Register all input events
[CLink]
public static extern void PollInputEvents();
/// Wait for some time (halt program execution)
[CLink]
public static extern void WaitTime(double seconds);
/// Set the seed for the random number generator /// Set the seed for the random number generator
[CLink] [CLink]
public static extern void SetRandomSeed(int32 seed); public static extern void SetRandomSeed(int32 seed);
/// Get a random value between min and max (both included)
[CLink]
public static extern int32 GetRandomValue(int32 min, int32 max);
/// Load random values sequence, no values repeated
[CLink]
public static extern int32 * LoadRandomSequence(int32 count, int32 min, int32 max);
/// Unload random values sequence
[CLink]
public static extern void UnloadRandomSequence(int32 * sequence);
/// Takes a screenshot of current screen (filename extension defines format) /// Takes a screenshot of current screen (filename extension defines format)
[CLink] [CLink]
public static extern void TakeScreenshot(char8 * fileName); public static extern void TakeScreenshot(char8 * fileName);
@ -489,6 +509,10 @@ public static class Raylib
[CLink] [CLink]
public static extern void SetConfigFlags(int32 flags); public static extern void SetConfigFlags(int32 flags);
/// Open URL with default system browser (if available)
[CLink]
public static extern void OpenURL(char8 * url);
/// Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...) /// Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR...)
[CLink] [CLink]
public static extern void TraceLog(int32 logLevel, char8 * text); public static extern void TraceLog(int32 logLevel, char8 * text);
@ -509,10 +533,6 @@ public static class Raylib
[CLink] [CLink]
public static extern void MemFree(void * ptr); public static extern void MemFree(void * ptr);
/// Open URL with default system browser (if available)
[CLink]
public static extern void OpenURL(char8 * url);
/// Set custom trace log /// Set custom trace log
[CLink] [CLink]
public static extern void SetTraceLogCallback(TraceLogCallback callback); public static extern void SetTraceLogCallback(TraceLogCallback callback);
@ -535,7 +555,7 @@ public static class Raylib
/// Load file data as byte array (read) /// Load file data as byte array (read)
[CLink] [CLink]
public static extern char8 * LoadFileData(char8 * fileName, int32 * bytesRead); public static extern char8 * LoadFileData(char8 * fileName, int32 * dataSize);
/// Unload file data allocated by LoadFileData() /// Unload file data allocated by LoadFileData()
[CLink] [CLink]
@ -543,11 +563,11 @@ public static class Raylib
/// Save data to file from byte array (write), returns true on success /// Save data to file from byte array (write), returns true on success
[CLink] [CLink]
public static extern bool SaveFileData(char8 * fileName, void * data, int32 bytesToWrite); public static extern bool SaveFileData(char8 * fileName, void * data, int32 dataSize);
/// Export data to code (.h), returns true on success /// Export data to code (.h), returns true on success
[CLink] [CLink]
public static extern bool ExportDataAsCode(char8 * data, int32 size, char8 * fileName); public static extern bool ExportDataAsCode(char8 * data, int32 dataSize, char8 * fileName);
/// Load text data from file (read), returns a '\0' terminated string /// Load text data from file (read), returns a '\0' terminated string
[CLink] [CLink]
@ -601,7 +621,7 @@ public static class Raylib
[CLink] [CLink]
public static extern char8 * GetWorkingDirectory(); public static extern char8 * GetWorkingDirectory();
/// Get the directory if the running application (uses static string) /// Get the directory of the running application (uses static string)
[CLink] [CLink]
public static extern char8 * GetApplicationDirectory(); public static extern char8 * GetApplicationDirectory();
@ -657,10 +677,46 @@ public static class Raylib
[CLink] [CLink]
public static extern char8 * DecodeDataBase64(char8 * data, int32 * outputSize); public static extern char8 * DecodeDataBase64(char8 * data, int32 * outputSize);
/// 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);
/// Export automation events list as text file
[CLink]
public static extern bool ExportAutomationEventList(AutomationEventList list, char8 * fileName);
/// Set automation event list to record to
[CLink]
public static extern void SetAutomationEventList(AutomationEventList * list);
/// Set automation event internal base frame to start recording
[CLink]
public static extern void SetAutomationEventBaseFrame(int32 frame);
/// Start recording automation events (AutomationEventList must be set)
[CLink]
public static extern void StartAutomationEventRecording();
/// Stop recording automation events
[CLink]
public static extern void StopAutomationEventRecording();
/// Play a recorded automation event
[CLink]
public static extern void PlayAutomationEvent(AutomationEvent event);
/// Check if a key has been pressed once /// Check if a key has been pressed once
[CLink] [CLink]
public static extern bool IsKeyPressed(int32 key); public static extern bool IsKeyPressed(int32 key);
/// Check if a key has been pressed again (Only PLATFORM_DESKTOP)
[CLink]
public static extern bool IsKeyPressedRepeat(int32 key);
/// Check if a key is being pressed /// Check if a key is being pressed
[CLink] [CLink]
public static extern bool IsKeyDown(int32 key); public static extern bool IsKeyDown(int32 key);
@ -673,10 +729,6 @@ public static class Raylib
[CLink] [CLink]
public static extern bool IsKeyUp(int32 key); public static extern bool IsKeyUp(int32 key);
/// Set a custom key to exit program (default is ESC)
[CLink]
public static extern void SetExitKey(int32 key);
/// Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty /// Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
[CLink] [CLink]
public static extern int32 GetKeyPressed(); public static extern int32 GetKeyPressed();
@ -685,6 +737,10 @@ public static class Raylib
[CLink] [CLink]
public static extern int32 GetCharPressed(); public static extern int32 GetCharPressed();
/// Set a custom key to exit program (default is ESC)
[CLink]
public static extern void SetExitKey(int32 key);
/// Check if a gamepad is available /// Check if a gamepad is available
[CLink] [CLink]
public static extern bool IsGamepadAvailable(int32 gamepad); public static extern bool IsGamepadAvailable(int32 gamepad);
@ -857,30 +913,22 @@ public static class Raylib
[CLink] [CLink]
public static extern void DrawLine(int32 startPosX, int32 startPosY, int32 endPosX, int32 endPosY, Color color); public static extern void DrawLine(int32 startPosX, int32 startPosY, int32 endPosX, int32 endPosY, Color color);
/// Draw a line (Vector version) /// Draw a line (using gl lines)
[CLink] [CLink]
public static extern void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); public static extern void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);
/// Draw a line defining thickness /// Draw a line (using triangles/quads)
[CLink] [CLink]
public static extern void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); public static extern void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);
/// Draw a line using cubic-bezier curves in-out /// Draw lines sequence (using gl lines)
[CLink]
public static extern void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);
/// Draw line using quadratic bezier curves with a control point
[CLink]
public static extern void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color);
/// Draw line using cubic bezier curves with 2 control points
[CLink]
public static extern void DrawLineBezierCubic(Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thick, Color color);
/// Draw lines sequence
[CLink] [CLink]
public static extern void DrawLineStrip(Vector2 * points, int32 pointCount, Color color); public static extern void DrawLineStrip(Vector2 * points, int32 pointCount, Color color);
/// Draw line segment cubic-bezier in-out interpolation
[CLink]
public static extern void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);
/// Draw a color-filled circle /// Draw a color-filled circle
[CLink] [CLink]
public static extern void DrawCircle(int32 centerX, int32 centerY, float radius, Color color); public static extern void DrawCircle(int32 centerX, int32 centerY, float radius, Color color);
@ -905,6 +953,10 @@ public static class Raylib
[CLink] [CLink]
public static extern void DrawCircleLines(int32 centerX, int32 centerY, float radius, Color color); public static extern void DrawCircleLines(int32 centerX, int32 centerY, float radius, Color color);
/// Draw circle outline (Vector version)
[CLink]
public static extern void DrawCircleLinesV(Vector2 center, float radius, Color color);
/// Draw ellipse /// Draw ellipse
[CLink] [CLink]
public static extern void DrawEllipse(int32 centerX, int32 centerY, float radiusH, float radiusV, Color color); public static extern void DrawEllipse(int32 centerX, int32 centerY, float radiusH, float radiusV, Color color);
@ -993,6 +1045,66 @@ public static class Raylib
[CLink] [CLink]
public static extern void DrawPolyLinesEx(Vector2 center, int32 sides, float radius, float rotation, float lineThick, Color color); public static extern void DrawPolyLinesEx(Vector2 center, int32 sides, float radius, float rotation, float lineThick, Color color);
/// Draw spline: Linear, minimum 2 points
[CLink]
public static extern void DrawSplineLinear(Vector2 * points, int32 pointCount, float thick, Color color);
/// Draw spline: B-Spline, minimum 4 points
[CLink]
public static extern void DrawSplineBasis(Vector2 * points, int32 pointCount, float thick, Color color);
/// Draw spline: Catmull-Rom, minimum 4 points
[CLink]
public static extern void DrawSplineCatmullRom(Vector2 * points, int32 pointCount, float thick, Color color);
/// Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
[CLink]
public static extern void DrawSplineBezierQuadratic(Vector2 * points, int32 pointCount, float thick, Color color);
/// Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
[CLink]
public static extern void DrawSplineBezierCubic(Vector2 * points, int32 pointCount, float thick, Color color);
/// Draw spline segment: Linear, 2 points
[CLink]
public static extern void DrawSplineSegmentLinear(Vector2 p1, Vector2 p2, float thick, Color color);
/// Draw spline segment: B-Spline, 4 points
[CLink]
public static extern void DrawSplineSegmentBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color);
/// Draw spline segment: Catmull-Rom, 4 points
[CLink]
public static extern void DrawSplineSegmentCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float thick, Color color);
/// Draw spline segment: Quadratic Bezier, 2 points, 1 control point
[CLink]
public static extern void DrawSplineSegmentBezierQuadratic(Vector2 p1, Vector2 c2, Vector2 p3, float thick, Color color);
/// Draw spline segment: Cubic Bezier, 2 points, 2 control points
[CLink]
public static extern void DrawSplineSegmentBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float thick, Color color);
/// Get (evaluate) spline point: Linear
[CLink]
public static extern Vector2 GetSplinePointLinear(Vector2 startPos, Vector2 endPos, float t);
/// Get (evaluate) spline point: B-Spline
[CLink]
public static extern Vector2 GetSplinePointBasis(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t);
/// Get (evaluate) spline point: Catmull-Rom
[CLink]
public static extern Vector2 GetSplinePointCatmullRom(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, float t);
/// Get (evaluate) spline point: Quadratic Bezier
[CLink]
public static extern Vector2 GetSplinePointBezierQuad(Vector2 p1, Vector2 c2, Vector2 p3, float t);
/// Get (evaluate) spline point: Cubic Bezier
[CLink]
public static extern Vector2 GetSplinePointBezierCubic(Vector2 p1, Vector2 c2, Vector2 c3, Vector2 p4, float t);
/// Check collision between two rectangles /// Check collision between two rectangles
[CLink] [CLink]
public static extern bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); public static extern bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2);
@ -1041,6 +1153,10 @@ public static class Raylib
[CLink] [CLink]
public static extern Image LoadImageRaw(char8 * fileName, int32 width, int32 height, int32 format, int32 headerSize); 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) /// Load image sequence from file (frames appended to image.data)
[CLink] [CLink]
public static extern Image LoadImageAnim(char8 * fileName, int32 * frames); public static extern Image LoadImageAnim(char8 * fileName, int32 * frames);
@ -1069,6 +1185,10 @@ public static class Raylib
[CLink] [CLink]
public static extern bool ExportImage(Image image, char8 * fileName); public static extern bool ExportImage(Image image, char8 * fileName);
/// Export image to memory buffer
[CLink]
public static extern char8 * ExportImageToMemory(Image image, char8 * fileType, int32 * fileSize);
/// Export image as code file defining an array of bytes, returns true on success /// Export image as code file defining an array of bytes, returns true on success
[CLink] [CLink]
public static extern bool ExportImageAsCode(Image image, char8 * fileName); public static extern bool ExportImageAsCode(Image image, char8 * fileName);
@ -1077,18 +1197,18 @@ public static class Raylib
[CLink] [CLink]
public static extern Image GenImageColor(int32 width, int32 height, Color color); public static extern Image GenImageColor(int32 width, int32 height, Color color);
/// Generate image: vertical gradient /// Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient
[CLink] [CLink]
public static extern Image GenImageGradientV(int32 width, int32 height, Color top, Color bottom); public static extern Image GenImageGradientLinear(int32 width, int32 height, int32 direction, Color start, Color end);
/// Generate image: horizontal gradient
[CLink]
public static extern Image GenImageGradientH(int32 width, int32 height, Color left, Color right);
/// Generate image: radial gradient /// Generate image: radial gradient
[CLink] [CLink]
public static extern Image GenImageGradientRadial(int32 width, int32 height, float density, Color inner, Color outer); public static extern Image GenImageGradientRadial(int32 width, int32 height, float density, Color inner, Color outer);
/// Generate image: square gradient
[CLink]
public static extern Image GenImageGradientSquare(int32 width, int32 height, float density, Color inner, Color outer);
/// Generate image: checked /// Generate image: checked
[CLink] [CLink]
public static extern Image GenImageChecked(int32 width, int32 height, int32 checksX, int32 checksY, Color col1, Color col2); public static extern Image GenImageChecked(int32 width, int32 height, int32 checksX, int32 checksY, Color col1, Color col2);
@ -1185,6 +1305,10 @@ public static class Raylib
[CLink] [CLink]
public static extern void ImageFlipHorizontal(Image * image); public static extern void ImageFlipHorizontal(Image * image);
/// Rotate image by input angle in degrees (-359 to 359)
[CLink]
public static extern void ImageRotate(Image * image, int32 degrees);
/// Rotate image clockwise 90deg /// Rotate image clockwise 90deg
[CLink] [CLink]
public static extern void ImageRotateCW(Image * image); public static extern void ImageRotateCW(Image * image);
@ -1449,9 +1573,9 @@ public static class Raylib
[CLink] [CLink]
public static extern Font LoadFont(char8 * fileName); public static extern Font LoadFont(char8 * fileName);
/// Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set /// Load font from file with extended parameters, use NULL for codepoints and 0 for codepointCount to load the default character setFont
[CLink] [CLink]
public static extern Font LoadFontEx(char8 * fileName, int32 fontSize, int32 * fontChars, int32 glyphCount); public static extern Font LoadFontEx(char8 * fileName, int32 fontSize, int32 * codepoints, int32 codepointCount);
/// Load font from Image (XNA style) /// Load font from Image (XNA style)
[CLink] [CLink]
@ -1459,7 +1583,7 @@ public static class Raylib
/// Load font from memory buffer, fileType refers to extension: i.e. '.ttf' /// Load font from memory buffer, fileType refers to extension: i.e. '.ttf'
[CLink] [CLink]
public static extern Font LoadFontFromMemory(char8 * fileType, char8 * fileData, int32 dataSize, int32 fontSize, int32 * fontChars, int32 glyphCount); public static extern Font LoadFontFromMemory(char8 * fileType, char8 * fileData, int32 dataSize, int32 fontSize, int32 * codepoints, int32 codepointCount);
/// Check if a font is ready /// Check if a font is ready
[CLink] [CLink]
@ -1467,15 +1591,15 @@ public static class Raylib
/// Load font data for further use /// Load font data for further use
[CLink] [CLink]
public static extern GlyphInfo * LoadFontData(char8 * fileData, int32 dataSize, int32 fontSize, int32 * fontChars, int32 glyphCount, int32 type); public static extern GlyphInfo * LoadFontData(char8 * fileData, int32 dataSize, int32 fontSize, int32 * codepoints, int32 codepointCount, int32 type);
/// Generate image font atlas using chars info /// Generate image font atlas using chars info
[CLink] [CLink]
public static extern Image GenImageFontAtlas(GlyphInfo * chars, Rectangle ** recs, int32 glyphCount, int32 fontSize, int32 padding, int32 packMethod); public static extern Image GenImageFontAtlas(GlyphInfo * glyphs, Rectangle ** glyphRecs, int32 glyphCount, int32 fontSize, int32 padding, int32 packMethod);
/// Unload font chars info data (RAM) /// Unload font chars info data (RAM)
[CLink] [CLink]
public static extern void UnloadFontData(GlyphInfo * chars, int32 glyphCount); public static extern void UnloadFontData(GlyphInfo * glyphs, int32 glyphCount);
/// Unload font from GPU memory (VRAM) /// Unload font from GPU memory (VRAM)
[CLink] [CLink]
@ -1507,7 +1631,11 @@ public static class Raylib
/// Draw multiple character (codepoint) /// Draw multiple character (codepoint)
[CLink] [CLink]
public static extern void DrawTextCodepoints(Font font, int32 * codepoints, int32 count, Vector2 position, float fontSize, float spacing, Color tint); public static extern void DrawTextCodepoints(Font font, int32 * codepoints, int32 codepointCount, Vector2 position, float fontSize, float spacing, Color tint);
/// Set vertical line spacing when drawing with line-breaks
[CLink]
public static extern void SetTextLineSpacing(int32 spacing);
/// Measure string width for default font /// Measure string width for default font
[CLink] [CLink]
@ -1875,7 +2003,7 @@ public static class Raylib
/// Unload animation array data /// Unload animation array data
[CLink] [CLink]
public static extern void UnloadModelAnimations(ModelAnimation * animations, int32 count); public static extern void UnloadModelAnimations(ModelAnimation * animations, int32 animCount);
/// Check model animation skeleton match /// Check model animation skeleton match
[CLink] [CLink]
@ -1929,6 +2057,10 @@ public static class Raylib
[CLink] [CLink]
public static extern void SetMasterVolume(float volume); public static extern void SetMasterVolume(float volume);
/// Get master volume (listener)
[CLink]
public static extern float GetMasterVolume();
/// Load wave data from file /// Load wave data from file
[CLink] [CLink]
public static extern Wave LoadWave(char8 * fileName); public static extern Wave LoadWave(char8 * fileName);
@ -1949,6 +2081,10 @@ public static class Raylib
[CLink] [CLink]
public static extern Sound LoadSoundFromWave(Wave wave); public static extern Sound LoadSoundFromWave(Wave wave);
/// Create a new sound that shares the same sample data as the source sound, does not own the sound data
[CLink]
public static extern Sound LoadSoundAlias(Sound source);
/// Checks if a sound is ready /// Checks if a sound is ready
[CLink] [CLink]
public static extern bool IsSoundReady(Sound sound); public static extern bool IsSoundReady(Sound sound);
@ -1965,6 +2101,10 @@ public static class Raylib
[CLink] [CLink]
public static extern void UnloadSound(Sound sound); public static extern void UnloadSound(Sound sound);
/// Unload a sound alias (does not deallocate sample data)
[CLink]
public static extern void UnloadSoundAlias(Sound alias);
/// Export wave data to file, returns true on success /// Export wave data to file, returns true on success
[CLink] [CLink]
public static extern bool ExportWave(Wave wave, char8 * fileName); public static extern bool ExportWave(Wave wave, char8 * fileName);
@ -2149,7 +2289,7 @@ public static class Raylib
[CLink] [CLink]
public static extern void SetAudioStreamCallback(AudioStream stream, AudioCallback callback); public static extern void SetAudioStreamCallback(AudioStream stream, AudioCallback callback);
/// Attach audio stream processor to stream /// Attach audio stream processor to stream, receives the samples as <float>s
[CLink] [CLink]
public static extern void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor); public static extern void AttachAudioStreamProcessor(AudioStream stream, AudioCallback processor);
@ -2157,7 +2297,7 @@ public static class Raylib
[CLink] [CLink]
public static extern void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor); public static extern void DetachAudioStreamProcessor(AudioStream stream, AudioCallback processor);
/// Attach audio stream processor to the entire audio pipeline /// Attach audio stream processor to the entire audio pipeline, receives the samples as <float>s
[CLink] [CLink]
public static extern void AttachAudioMixedProcessor(AudioCallback processor); public static extern void AttachAudioMixedProcessor(AudioCallback processor);
@ -2170,10 +2310,10 @@ public static class Raylib
public function void TraceLogCallback(int32 logLevel, char8 * text, void* args); public function void TraceLogCallback(int32 logLevel, char8 * text, void* args);
/// FileIO: Load binary data /// FileIO: Load binary data
public function char8 * LoadFileDataCallback(char8 * fileName, int32 * bytesRead); public function char8 * LoadFileDataCallback(char8 * fileName, int32 * dataSize);
/// FileIO: Save binary data /// FileIO: Save binary data
public function bool SaveFileDataCallback(char8 * fileName, void * data, int32 bytesToWrite); public function bool SaveFileDataCallback(char8 * fileName, void * data, int32 dataSize);
/// FileIO: Load text data /// FileIO: Load text data
public function char8 * LoadFileTextCallback(char8 * fileName); public function char8 * LoadFileTextCallback(char8 * fileName);

View file

@ -13,453 +13,5 @@ public static class Raymath
public const float RAD2DEG = (180.0f/PI); public const float RAD2DEG = (180.0f/PI);
///
[CLink]
public static extern float Clamp(float value, float min, float max);
///
[CLink]
public static extern float Lerp(float start, float end, float amount);
///
[CLink]
public static extern float Normalize(float value, float start, float end);
///
[CLink]
public static extern float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd);
///
[CLink]
public static extern float Wrap(float value, float min, float max);
///
[CLink]
public static extern int32 FloatEquals(float x, float y);
///
[CLink]
public static extern Vector2 Vector2Zero();
///
[CLink]
public static extern Vector2 Vector2One();
///
[CLink]
public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern Vector2 Vector2AddValue(Vector2 v, float add);
///
[CLink]
public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern Vector2 Vector2SubtractValue(Vector2 v, float sub);
///
[CLink]
public static extern float Vector2Length(Vector2 v);
///
[CLink]
public static extern float Vector2LengthSqr(Vector2 v);
///
[CLink]
public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern float Vector2Distance(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern float Vector2DistanceSqr(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern float Vector2Angle(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern float Vector2LineAngle(Vector2 start, Vector2 end);
///
[CLink]
public static extern Vector2 Vector2Scale(Vector2 v, float scale);
///
[CLink]
public static extern Vector2 Vector2Multiply(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern Vector2 Vector2Negate(Vector2 v);
///
[CLink]
public static extern Vector2 Vector2Divide(Vector2 v1, Vector2 v2);
///
[CLink]
public static extern Vector2 Vector2Normalize(Vector2 v);
///
[CLink]
public static extern Vector2 Vector2Transform(Vector2 v, Matrix mat);
///
[CLink]
public static extern Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount);
///
[CLink]
public static extern Vector2 Vector2Reflect(Vector2 v, Vector2 normal);
///
[CLink]
public static extern Vector2 Vector2Rotate(Vector2 v, float angle);
///
[CLink]
public static extern Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance);
///
[CLink]
public static extern Vector2 Vector2Invert(Vector2 v);
///
[CLink]
public static extern Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max);
///
[CLink]
public static extern Vector2 Vector2ClampValue(Vector2 v, float min, float max);
///
[CLink]
public static extern int32 Vector2Equals(Vector2 p, Vector2 q);
///
[CLink]
public static extern Vector3 Vector3Zero();
///
[CLink]
public static extern Vector3 Vector3One();
///
[CLink]
public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern Vector3 Vector3AddValue(Vector3 v, float add);
///
[CLink]
public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern Vector3 Vector3SubtractValue(Vector3 v, float sub);
///
[CLink]
public static extern Vector3 Vector3Scale(Vector3 v, float scalar);
///
[CLink]
public static extern Vector3 Vector3Multiply(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern Vector3 Vector3Perpendicular(Vector3 v);
///
[CLink]
public static extern float Vector3Length(Vector3 v);
///
[CLink]
public static extern float Vector3LengthSqr(Vector3 v);
///
[CLink]
public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern float Vector3Distance(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern float Vector3DistanceSqr(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern float Vector3Angle(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern Vector3 Vector3Negate(Vector3 v);
///
[CLink]
public static extern Vector3 Vector3Divide(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern Vector3 Vector3Normalize(Vector3 v);
///
[CLink]
public static extern void Vector3OrthoNormalize(Vector3 * v1, Vector3 * v2);
///
[CLink]
public static extern Vector3 Vector3Transform(Vector3 v, Matrix mat);
///
[CLink]
public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);
///
[CLink]
public static extern Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle);
///
[CLink]
public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);
///
[CLink]
public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal);
///
[CLink]
public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern Vector3 Vector3Max(Vector3 v1, Vector3 v2);
///
[CLink]
public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c);
///
[CLink]
public static extern Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view);
///
[CLink]
public static extern float3 Vector3ToFloatV(Vector3 v);
///
[CLink]
public static extern Vector3 Vector3Invert(Vector3 v);
///
[CLink]
public static extern Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max);
///
[CLink]
public static extern Vector3 Vector3ClampValue(Vector3 v, float min, float max);
///
[CLink]
public static extern int32 Vector3Equals(Vector3 p, Vector3 q);
///
[CLink]
public static extern Vector3 Vector3Refract(Vector3 v, Vector3 n, float r);
///
[CLink]
public static extern float MatrixDeterminant(Matrix mat);
///
[CLink]
public static extern float MatrixTrace(Matrix mat);
///
[CLink]
public static extern Matrix MatrixTranspose(Matrix mat);
///
[CLink]
public static extern Matrix MatrixInvert(Matrix mat);
///
[CLink]
public static extern Matrix MatrixIdentity();
///
[CLink]
public static extern Matrix MatrixAdd(Matrix left, Matrix right);
///
[CLink]
public static extern Matrix MatrixSubtract(Matrix left, Matrix right);
///
[CLink]
public static extern Matrix MatrixMultiply(Matrix left, Matrix right);
///
[CLink]
public static extern Matrix MatrixTranslate(float x, float y, float z);
///
[CLink]
public static extern Matrix MatrixRotate(Vector3 axis, float angle);
///
[CLink]
public static extern Matrix MatrixRotateX(float angle);
///
[CLink]
public static extern Matrix MatrixRotateY(float angle);
///
[CLink]
public static extern Matrix MatrixRotateZ(float angle);
///
[CLink]
public static extern Matrix MatrixRotateXYZ(Vector3 angle);
///
[CLink]
public static extern Matrix MatrixRotateZYX(Vector3 angle);
///
[CLink]
public static extern Matrix MatrixScale(float x, float y, float z);
///
[CLink]
public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far);
///
[CLink]
public static extern Matrix MatrixPerspective(double fovy, double aspect, double near, double far);
///
[CLink]
public static extern Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far);
///
[CLink]
public static extern Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
///
[CLink]
public static extern float16 MatrixToFloatV(Matrix mat);
///
[CLink]
public static extern Quaternion QuaternionAdd(Quaternion q1, Quaternion q2);
///
[CLink]
public static extern Quaternion QuaternionAddValue(Quaternion q, float add);
///
[CLink]
public static extern Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2);
///
[CLink]
public static extern Quaternion QuaternionSubtractValue(Quaternion q, float sub);
///
[CLink]
public static extern Quaternion QuaternionIdentity();
///
[CLink]
public static extern float QuaternionLength(Quaternion q);
///
[CLink]
public static extern Quaternion QuaternionNormalize(Quaternion q);
///
[CLink]
public static extern Quaternion QuaternionInvert(Quaternion q);
///
[CLink]
public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);
///
[CLink]
public static extern Quaternion QuaternionScale(Quaternion q, float mul);
///
[CLink]
public static extern Quaternion QuaternionDivide(Quaternion q1, Quaternion q2);
///
[CLink]
public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);
///
[CLink]
public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);
///
[CLink]
public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
///
[CLink]
public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
///
[CLink]
public static extern Quaternion QuaternionFromMatrix(Matrix mat);
///
[CLink]
public static extern Matrix QuaternionToMatrix(Quaternion q);
///
[CLink]
public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);
///
[CLink]
public static extern void QuaternionToAxisAngle(Quaternion q, Vector3 * outAxis, float * outAngle);
///
[CLink]
public static extern Quaternion QuaternionFromEuler(float pitch, float yaw, float roll);
///
[CLink]
public static extern Vector3 QuaternionToEuler(Quaternion q);
///
[CLink]
public static extern Quaternion QuaternionTransform(Quaternion q, Matrix mat);
///
[CLink]
public static extern int32 QuaternionEquals(Quaternion p, Quaternion q);
} }

View file

@ -222,6 +222,95 @@ public static class Rlgl
/// GL_BLEND_COLOR /// GL_BLEND_COLOR
public const int32 RL_BLEND_COLOR = 32773; public const int32 RL_BLEND_COLOR = 32773;
public const float PI = 3.141592653589793f;
public const float DEG2RAD = (PI/180.0f);
public const float RAD2DEG = (180.0f/PI);
public const int32 GL_SHADING_LANGUAGE_VERSION = 35724;
public const int32 GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 33776;
public const int32 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777;
public const int32 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778;
public const int32 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779;
public const int32 GL_ETC1_RGB8_OES = 36196;
public const int32 GL_COMPRESSED_RGB8_ETC2 = 37492;
public const int32 GL_COMPRESSED_RGBA8_ETC2_EAC = 37496;
public const int32 GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840;
public const int32 GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842;
public const int32 GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 37808;
public const int32 GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 37815;
public const int32 GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 34047;
public const int32 GL_TEXTURE_MAX_ANISOTROPY_EXT = 34046;
public const int32 GL_UNSIGNED_SHORT_5_6_5 = 33635;
public const int32 GL_UNSIGNED_SHORT_5_5_5_1 = 32820;
public const int32 GL_UNSIGNED_SHORT_4_4_4_4 = 32819;
public const int32 GL_LUMINANCE = 6409;
public const int32 GL_LUMINANCE_ALPHA = 6410;
/// Bound by default to shader location: 0
public const char8* RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION = "vertexPosition";
/// Bound by default to shader location: 1
public const char8* RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD = "vertexTexCoord";
/// Bound by default to shader location: 2
public const char8* RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL = "vertexNormal";
/// Bound by default to shader location: 3
public const char8* RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR = "vertexColor";
/// Bound by default to shader location: 4
public const char8* RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT = "vertexTangent";
/// Bound by default to shader location: 5
public const char8* RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 = "vertexTexCoord2";
/// model-view-projection matrix
public const char8* RL_DEFAULT_SHADER_UNIFORM_NAME_MVP = "mvp";
/// view matrix
public const char8* RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW = "matView";
/// projection matrix
public const char8* RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION = "matProjection";
/// model matrix
public const char8* RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL = "matModel";
/// normal matrix (transpose(inverse(matModelView))
public const char8* RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL = "matNormal";
/// color diffuse (base tint color, multiplied by texture color)
public const char8* RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR = "colDiffuse";
/// texture0 (texture slot active 0)
public const char8* RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 = "texture0";
/// texture1 (texture slot active 1)
public const char8* RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 = "texture1";
/// texture2 (texture slot active 2)
public const char8* RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 = "texture2";
/// Choose the current matrix to be transformed /// Choose the current matrix to be transformed
[CLink] [CLink]
public static extern void rlMatrixMode(int32 mode); public static extern void rlMatrixMode(int32 mode);
@ -394,6 +483,10 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlActiveDrawBuffers(int32 count); public static extern void rlActiveDrawBuffers(int32 count);
/// Blit active framebuffer to main framebuffer
[CLink]
public static extern void rlBlitFramebuffer(int32 srcX, int32 srcY, int32 srcWidth, int32 srcHeight, int32 dstX, int32 dstY, int32 dstWidth, int32 dstHeight, int32 bufferMask);
/// Enable color blending /// Enable color blending
[CLink] [CLink]
public static extern void rlEnableColorBlend(); public static extern void rlEnableColorBlend();
@ -446,7 +539,11 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlEnableWireMode(); public static extern void rlEnableWireMode();
/// Disable wire mode /// Enable point mode
[CLink]
public static extern void rlEnablePointMode();
/// Disable wire mode ( and point ) maybe rename
[CLink] [CLink]
public static extern void rlDisableWireMode(); public static extern void rlDisableWireMode();
@ -810,5 +907,7 @@ public static class Rlgl
[CLink] [CLink]
public static extern void rlLoadDrawQuad(); public static extern void rlLoadDrawQuad();
/// OpenGL extension functions loader signature (same as GLADloadproc)
public function void * rlglLoadProc(char8 * name);
} }

View file

@ -16,4 +16,6 @@ public enum rlGlVersion : c_int
RL_OPENGL_43 = 4, RL_OPENGL_43 = 4,
/// OpenGL ES 2.0 (GLSL 100) /// OpenGL ES 2.0 (GLSL 100)
RL_OPENGL_ES_20 = 5, RL_OPENGL_ES_20 = 5,
/// OpenGL ES 3.0 (GLSL 300 es)
RL_OPENGL_ES_30 = 6,
} }

View file

@ -26,26 +26,32 @@ public enum rlPixelFormat : c_int
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9, RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9,
/// 32*4 bpp (4 channels - float) /// 32*4 bpp (4 channels - float)
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10, RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10,
/// 16 bpp (1 channel - half float)
RL_PIXELFORMAT_UNCOMPRESSED_R16 = 11,
/// 16*3 bpp (3 channels - half float)
RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16 = 12,
/// 16*4 bpp (4 channels - half float)
RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 = 13,
/// 4 bpp (no alpha) /// 4 bpp (no alpha)
RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 11, RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 14,
/// 4 bpp (1 bit alpha) /// 4 bpp (1 bit alpha)
RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12, RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15,
/// 8 bpp /// 8 bpp
RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13, RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16,
/// 8 bpp /// 8 bpp
RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14, RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17,
/// 4 bpp /// 4 bpp
RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 15, RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 18,
/// 4 bpp /// 4 bpp
RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 16, RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 19,
/// 8 bpp /// 8 bpp
RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17, RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20,
/// 4 bpp /// 4 bpp
RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 18, RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 21,
/// 4 bpp /// 4 bpp
RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19, RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22,
/// 8 bpp /// 8 bpp
RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20, RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23,
/// 2 bpp /// 2 bpp
RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21, RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24,
} }

View file

@ -18,22 +18,34 @@ public struct rlVertexBuffer
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
public char8 * colors; public char8 * colors;
///
public void* rlRenderBatch;
/// Vertex indices (in case vertex data comes indexed) (6 indices per quad) /// Vertex indices (in case vertex data comes indexed) (6 indices per quad)
public void* indices; public int32 * indices;
/// Number of vertex required for index alignment (LINES, TRIANGLES)
public void* vertexAlignment;
/// Shader id to be used on the draw -> Using RLGL.currentShaderId
public void* shaderId;
/// OpenGL Vertex Array Object id /// OpenGL Vertex Array Object id
public void* vaoId; public int32 vaoId;
/// OpenGL Vertex Buffer Objects id (4 types of vertex data) /// OpenGL Vertex Buffer Objects id (4 types of vertex data)
public int32[4] vboId; public int32[4] vboId;
public this(int32 elementCount, float * vertices, float * texcoords, char8 * colors, void* indices, void* vaoId, int32[4] vboId) public this(int32 elementCount, float * vertices, float * texcoords, char8 * colors, void* rlRenderBatch, int32 * indices, void* vertexAlignment, void* shaderId, int32 vaoId, int32[4] vboId)
{ {
this.elementCount = elementCount; this.elementCount = elementCount;
this.vertices = vertices; this.vertices = vertices;
this.texcoords = texcoords; this.texcoords = texcoords;
this.colors = colors; this.colors = colors;
this.rlRenderBatch = rlRenderBatch;
this.indices = indices; this.indices = indices;
this.vertexAlignment = vertexAlignment;
this.shaderId = shaderId;
this.vaoId = vaoId; this.vaoId = vaoId;
this.vboId = vboId; this.vboId = vboId;
} }

188
raylib-beef/src/rlglData.bf Normal file
View file

@ -0,0 +1,188 @@
using System;
using System.Interop;
namespace RaylibBeef;
[CRepr]
public struct rlglData
{
/// Current render batch
public rlRenderBatch * currentBatch;
/// Default internal render batch
public rlRenderBatch defaultBatch;
/// Current active render batch vertex counter (generic, used for all batches)
public int32 vertexCounter;
/// Current active texture coordinate (added on glVertex*())
public float texcoordx;
/// Current active texture coordinate (added on glVertex*())
public float texcoordy;
/// Current active normal (added on glVertex*())
public float normalx;
/// Current active normal (added on glVertex*())
public float normaly;
/// Current active normal (added on glVertex*())
public float normalz;
/// Current active color (added on glVertex*())
public uint8 colorr;
/// Current active color (added on glVertex*())
public uint8 colorg;
/// Current active color (added on glVertex*())
public uint8 colorb;
/// Current active color (added on glVertex*())
public uint8 colora;
/// Current matrix mode
public int32 currentMatrixMode;
/// Current matrix pointer
public Matrix * currentMatrix;
/// Default modelview matrix
public Matrix modelview;
/// Default projection matrix
public Matrix projection;
/// Transform matrix to be used with rlTranslate, rlRotate, rlScale
public Matrix transform;
/// Require transform matrix application to current draw-call vertex (if required)
public bool transformRequired;
/// Matrix stack for push/pop
public Matrix[Rlgl.RL_MAX_MATRIX_STACK_SIZE] _stack;
/// Matrix stack counter
public int32 stackCounter;
/// Default texture used on shapes/poly drawing (required by shader)
public int32 defaultTextureId;
/// Active texture ids to be enabled on batch drawing (0 active by default)
public int32[Rlgl.RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS] activeTextureId;
/// Default vertex shader id (used by default shader program)
public int32 defaultVShaderId;
/// Default fragment shader id (used by default shader program)
public int32 defaultFShaderId;
/// Default shader program id, supports vertex color and diffuse texture
public int32 defaultShaderId;
/// Default shader locations pointer to be used on rendering
public int32 * defaultShaderLocs;
/// Current shader id to be used on rendering (by default, defaultShaderId)
public int32 currentShaderId;
/// Current shader locations pointer to be used on rendering (by default, defaultShaderLocs)
public int32 * currentShaderLocs;
/// Stereo rendering flag
public bool stereoRender;
/// VR stereo rendering eyes projection matrices
public Matrix[2] projectionStereo;
/// VR stereo rendering eyes view offset matrices
public Matrix[2] viewOffsetStereo;
/// Blending mode active
public int32 currentBlendMode;
/// Blending source factor
public int32 glBlendSrcFactor;
/// Blending destination factor
public int32 glBlendDstFactor;
/// Blending equation
public int32 glBlendEquation;
/// Blending source RGB factor
public int32 glBlendSrcFactorRGB;
/// Blending destination RGB factor
public int32 glBlendDestFactorRGB;
/// Blending source alpha factor
public int32 glBlendSrcFactorAlpha;
/// Blending destination alpha factor
public int32 glBlendDestFactorAlpha;
/// Blending equation for RGB
public int32 glBlendEquationRGB;
/// Blending equation for alpha
public int32 glBlendEquationAlpha;
/// Custom blending factor and equation modification status
public bool glCustomBlendModeModified;
/// Current framebuffer width
public int32 framebufferWidth;
/// Current framebuffer height
public int32 framebufferHeight;
public this(rlRenderBatch * currentBatch, rlRenderBatch defaultBatch, int32 vertexCounter, float texcoordx, float texcoordy, float normalx, float normaly, float normalz, uint8 colorr, uint8 colorg, uint8 colorb, uint8 colora, int32 currentMatrixMode, Matrix * currentMatrix, Matrix modelview, Matrix projection, Matrix transform, bool transformRequired, Matrix[Rlgl.RL_MAX_MATRIX_STACK_SIZE] _stack, int32 stackCounter, int32 defaultTextureId, int32[Rlgl.RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS] activeTextureId, int32 defaultVShaderId, int32 defaultFShaderId, int32 defaultShaderId, int32 * defaultShaderLocs, int32 currentShaderId, int32 * currentShaderLocs, bool stereoRender, Matrix[2] projectionStereo, Matrix[2] viewOffsetStereo, int32 currentBlendMode, int32 glBlendSrcFactor, int32 glBlendDstFactor, int32 glBlendEquation, int32 glBlendSrcFactorRGB, int32 glBlendDestFactorRGB, int32 glBlendSrcFactorAlpha, int32 glBlendDestFactorAlpha, int32 glBlendEquationRGB, int32 glBlendEquationAlpha, bool glCustomBlendModeModified, int32 framebufferWidth, int32 framebufferHeight)
{
this.currentBatch = currentBatch;
this.defaultBatch = defaultBatch;
this.vertexCounter = vertexCounter;
this.texcoordx = texcoordx;
this.texcoordy = texcoordy;
this.normalx = normalx;
this.normaly = normaly;
this.normalz = normalz;
this.colorr = colorr;
this.colorg = colorg;
this.colorb = colorb;
this.colora = colora;
this.currentMatrixMode = currentMatrixMode;
this.currentMatrix = currentMatrix;
this.modelview = modelview;
this.projection = projection;
this.transform = transform;
this.transformRequired = transformRequired;
this._stack = _stack;
this.stackCounter = stackCounter;
this.defaultTextureId = defaultTextureId;
this.activeTextureId = activeTextureId;
this.defaultVShaderId = defaultVShaderId;
this.defaultFShaderId = defaultFShaderId;
this.defaultShaderId = defaultShaderId;
this.defaultShaderLocs = defaultShaderLocs;
this.currentShaderId = currentShaderId;
this.currentShaderLocs = currentShaderLocs;
this.stereoRender = stereoRender;
this.projectionStereo = projectionStereo;
this.viewOffsetStereo = viewOffsetStereo;
this.currentBlendMode = currentBlendMode;
this.glBlendSrcFactor = glBlendSrcFactor;
this.glBlendDstFactor = glBlendDstFactor;
this.glBlendEquation = glBlendEquation;
this.glBlendSrcFactorRGB = glBlendSrcFactorRGB;
this.glBlendDestFactorRGB = glBlendDestFactorRGB;
this.glBlendSrcFactorAlpha = glBlendSrcFactorAlpha;
this.glBlendDestFactorAlpha = glBlendDestFactorAlpha;
this.glBlendEquationRGB = glBlendEquationRGB;
this.glBlendEquationAlpha = glBlendEquationAlpha;
this.glCustomBlendModeModified = glCustomBlendModeModified;
this.framebufferWidth = framebufferWidth;
this.framebufferHeight = framebufferHeight;
}
}