Upgrade Raylib to 6.0 (#337)
* Updated target to Raylib 6 + synced invoke called with the changes in C. [WARNING: Breaking changes!] * Added severial examples. Corrected towards the correct return type and add utilities to prevent working with pointers * Additional resources from the Raylib repo. * Fixed additional pinvokes to match with the new raylib bindings. [Warning breaking changes!] * Fixing the QOL utils * Fixing the Mesh struct * Applying changes after review. Merged resources.LICENSE + raylib-cs.Native.csproj only targets dotnet8 * Updated README to reflect .NET 10 and Raylib 6 compatibility changes. * Updated shader colors, adjusted car model scale, disabled HDR in SkyboxDemo, and fixed camera mode assignment. Removed unused `Capacity` field in FilePathList struct. * Improved XML comments for consistency, fixed spacing and formatting across examples, added new resources to `resources.LICENSE`. * Updated XML comment for `GetDirectoryFileCountEx` to clarify behavior and filtering options. * Updated and clarified XML comments for methods and parameters, improved naming consistency, and refined shader-related functions. Renamed enums in `Shader.cs` for so it is inline with the upstream. * Improved XML comments for clarity and consistency in `Model.cs` and `Mesh.cs`, updated method and variable names for better readability, and adjusted logic in span creation methods. * Corrected XML comment capitalization in `Model.cs`. --------- Co-authored-by: Meatcorps <info@meatcorps.nl>
This commit is contained in:
parent
1b890169c5
commit
21d83c60a9
189 changed files with 43644 additions and 380 deletions
|
|
@ -19,7 +19,7 @@ public static unsafe partial class Raylib
|
|||
/// </summary>
|
||||
public const string NativeLibName = "raylib";
|
||||
|
||||
public const string RAYLIB_VERSION = "5.5";
|
||||
public const string RAYLIB_VERSION = "6.0";
|
||||
|
||||
public const float DEG2RAD = MathF.PI / 180.0f;
|
||||
public const float RAD2DEG = 180.0f / MathF.PI;
|
||||
|
|
@ -207,7 +207,7 @@ public static unsafe partial class Raylib
|
|||
/// <summary>Set window configuration state using flags</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool SetWindowState(ConfigFlags flag);
|
||||
public static partial void SetWindowState(ConfigFlags flag);
|
||||
|
||||
/// <summary>Clear window configuration state flags</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -689,7 +689,7 @@ public static unsafe partial class Raylib
|
|||
/// <summary>Set the seed for the random number generator</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int SetRandomSeed(uint seed);
|
||||
public static partial void SetRandomSeed(uint seed);
|
||||
|
||||
/// <summary>Load random values sequence, no values repeated</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -701,6 +701,8 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadRandomSequence(int* sequence);
|
||||
|
||||
// Misc. functions
|
||||
|
||||
/// <summary>Takes a screenshot of current screen (saved a .png)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -711,6 +713,13 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetConfigFlags(ConfigFlags flags);
|
||||
|
||||
/// <summary>Open URL with default system browser (if available)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void OpenURL(sbyte* url);
|
||||
|
||||
// Logging system
|
||||
|
||||
/// <summary>Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -721,6 +730,8 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetTraceLogLevel(TraceLogLevel logLevel);
|
||||
|
||||
// Memory management, using internal allocators
|
||||
|
||||
/// <summary>Internal memory allocator</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -745,29 +756,6 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetTraceLogCallback(delegate* unmanaged[Cdecl]<int, sbyte*, sbyte*, void> callback);
|
||||
|
||||
/// <summary>Set custom file binary data loader</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetLoadFileDataCallback(delegate* unmanaged[Cdecl]<sbyte*, int*, byte*> callback);
|
||||
|
||||
/// <summary>Set custom file binary data saver</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetSaveFileDataCallback(
|
||||
delegate* unmanaged[Cdecl]<sbyte*, void*, int, CBool> callback
|
||||
);
|
||||
|
||||
/// <summary>Set custom file text data loader</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetLoadFileTextCallback(delegate* unmanaged[Cdecl]<sbyte*, sbyte*> callback);
|
||||
|
||||
/// <summary>Set custom file text data saver</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetSaveFileTextCallback(delegate* unmanaged[Cdecl]<sbyte*, sbyte*, CBool> callback);
|
||||
|
||||
|
||||
// Files management functions
|
||||
|
||||
/// <summary>Load file data as byte array (read)</summary>
|
||||
|
|
@ -790,27 +778,81 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool ExportDataAsCode(byte* data, int dataSize, sbyte* fileName);
|
||||
|
||||
// Load text data from file (read), returns a '\0' terminated string
|
||||
/// <summary>Load text data from file (read), returns a '\0' terminated string</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* LoadFileText(sbyte* fileName);
|
||||
|
||||
// Unload file text data allocated by LoadFileText()
|
||||
/// <summary>Unload file text data allocated by LoadFileText()</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadFileText(sbyte* text);
|
||||
|
||||
// Save text data to file (write), string must be '\0' terminated, returns true on success
|
||||
/// <summary>Save text data to file (write), string must be '\0' terminated, returns true on success</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool SaveFileText(sbyte* fileName, sbyte* text);
|
||||
|
||||
// Check if file exists
|
||||
// File access custom callbacks
|
||||
// WARNING: Callbacks setup is intended for advanced users
|
||||
/// <summary>Set custom file binary data loader</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetLoadFileDataCallback(delegate* unmanaged[Cdecl]<sbyte*, int*, byte*> callback);
|
||||
|
||||
/// <summary>Set custom file binary data saver</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetSaveFileDataCallback(
|
||||
delegate* unmanaged[Cdecl]<sbyte*, void*, int, CBool> callback
|
||||
);
|
||||
|
||||
/// <summary>Set custom file text data loader</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetLoadFileTextCallback(delegate* unmanaged[Cdecl]<sbyte*, sbyte*> callback);
|
||||
|
||||
/// <summary>Set custom file text data saver</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetSaveFileTextCallback(delegate* unmanaged[Cdecl]<sbyte*, sbyte*, CBool> callback);
|
||||
|
||||
/// <summary>Rename file (if exists)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int FileRename(sbyte* fileName, sbyte* fileRename);
|
||||
|
||||
/// <summary>Remove file (if exists)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int FileRemove(sbyte* fileName);
|
||||
|
||||
/// <summary>Copy file from one path to another, dstPath created if it doesn't exist</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int FileCopy(sbyte* srcPath, sbyte* dstPath);
|
||||
|
||||
/// <summary>Move file from one path to another, dstPath created if it doesn't exist</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int FileMove(sbyte* srcPath, sbyte* dstPath);
|
||||
|
||||
/// <summary>Replace text in an existing file</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int FileTextReplace(sbyte* fileName, sbyte* search, sbyte* replacement);
|
||||
|
||||
/// <summary>Find text in existing file</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int FileTextFindIndex(sbyte* fileName, sbyte* search);
|
||||
|
||||
/// <summary>Check if file exists</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool FileExists(sbyte* fileName);
|
||||
|
||||
// Check if a directory path exists
|
||||
/// <summary>Check if a directory path exists</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool DirectoryExists(sbyte* dirPath);
|
||||
|
|
@ -825,6 +867,11 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int GetFileLength(sbyte* fileName);
|
||||
|
||||
/// <summary>Get file modification time (last write time)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CLong GetFileModTime(sbyte* fileName);
|
||||
|
||||
/// <summary>Get pointer to extension for a filename string (includes dot: '.png')</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -865,20 +912,10 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int MakeDirectory(sbyte* dirPath);
|
||||
|
||||
/// <summary>Load directory filepaths</summary>
|
||||
/// <summary>Change working directory, return true on success</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial FilePathList LoadDirectoryFiles(sbyte* dirPath, int* count);
|
||||
|
||||
/// <summary>Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial FilePathList LoadDirectoryFilesEx(sbyte* basePath, sbyte* filter, CBool scanSubdirs);
|
||||
|
||||
/// <summary>Unload filepaths</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadDirectoryFiles(FilePathList files);
|
||||
public static partial CBool ChangeDirectory(sbyte* dirPath);
|
||||
|
||||
/// <summary>Check if a given path is a file or a directory</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -890,10 +927,20 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool IsFileNameValid(sbyte* fileName);
|
||||
|
||||
/// <summary>Change working directory, return true on success</summary>
|
||||
/// <summary>Load directory filepaths</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool ChangeDirectory(sbyte* dir);
|
||||
public static partial FilePathList LoadDirectoryFiles(sbyte* dirPath);
|
||||
|
||||
/// <summary>Load directory filepaths with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial FilePathList LoadDirectoryFilesEx(sbyte* basePath, sbyte* filter, CBool scanSubdirs);
|
||||
|
||||
/// <summary>Unload filepaths</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadDirectoryFiles(FilePathList files);
|
||||
|
||||
/// <summary>Check if a file has been dropped into window</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -910,11 +957,15 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadDroppedFiles(FilePathList files);
|
||||
|
||||
/// <summary>Get file modification time (last write time)</summary>
|
||||
/// <summary>Get the file count in a directory</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial long GetFileModTime(sbyte* fileName);
|
||||
public static partial int GetDirectoryFileCount(sbyte* dirPath);
|
||||
|
||||
/// <summary>Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int GetDirectoryFileCountEx(sbyte* dirPath, sbyte* filter, CBool scanSubdirs);
|
||||
|
||||
// Compression/Encoding functionality
|
||||
|
||||
|
|
@ -936,7 +987,7 @@ public static unsafe partial class Raylib
|
|||
/// <summary>Decode Base64 string data, memory must be MemFree()</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial byte* DecodeDataBase64(byte* data, int* outputSize);
|
||||
public static partial byte* DecodeDataBase64(sbyte* data, int* outputSize);
|
||||
|
||||
/// <summary>Compute CRC32 hash code</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -953,10 +1004,10 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial uint* ComputeSHA1(byte* data, int dataSize);
|
||||
|
||||
/// <summary>Open URL with default system browser (if available)</summary>
|
||||
/// <summary>Compute SHA256 hash code, returns static int[8] (32 bytes)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void OpenURL(sbyte* url);
|
||||
public static partial uint* ComputeSHA256(byte* data, int dataSize);
|
||||
|
||||
// Automation events functionality
|
||||
|
||||
|
|
@ -1031,11 +1082,6 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool IsKeyUp(KeyboardKey key);
|
||||
|
||||
/// <summary>Set a custom key to exit program (default is ESC)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetExitKey(KeyboardKey key);
|
||||
|
||||
/// <summary>
|
||||
/// Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
|
||||
/// </summary>
|
||||
|
|
@ -1050,6 +1096,16 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int GetCharPressed();
|
||||
|
||||
/// <summary>Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* GetKeyName(KeyboardKey key);
|
||||
|
||||
/// <summary>Set a custom key to exit program (default is ESC)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetExitKey(KeyboardKey key);
|
||||
|
||||
|
||||
// Input-related functions: gamepads
|
||||
|
||||
|
|
@ -1398,21 +1454,42 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);
|
||||
|
||||
/// <summary>Draw a line using cubic-bezier curves in-out</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);
|
||||
|
||||
/// <summary>Draw lines sequence</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawLineStrip(Vector2* points, int pointCount, Color color);
|
||||
|
||||
/// <summary>Draw a line using cubic-bezier curves in-out</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);
|
||||
|
||||
/// <summary>Draw a dashed line</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawLineDashed(Vector2 startPos, Vector2 endPos, int dashSize, int spaceSize, Color color);
|
||||
|
||||
/// <summary>Draw a color-filled circle</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawCircle(int centerX, int centerY, float radius, Color color);
|
||||
|
||||
|
||||
/// <summary>Draw a color-filled circle (Vector version)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawCircleV(Vector2 center, float radius, Color color);
|
||||
|
||||
/// <summary>Draw a gradient-filled circle</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawCircleGradient(
|
||||
Vector2 center,
|
||||
float radius,
|
||||
Color inner,
|
||||
Color outer
|
||||
);
|
||||
|
||||
/// <summary>Draw a piece of a circle</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -1437,22 +1514,6 @@ public static unsafe partial class Raylib
|
|||
Color color
|
||||
);
|
||||
|
||||
/// <summary>Draw a gradient-filled circle</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawCircleGradient(
|
||||
int centerX,
|
||||
int centerY,
|
||||
float radius,
|
||||
Color inner,
|
||||
Color outer
|
||||
);
|
||||
|
||||
/// <summary>Draw a color-filled circle (Vector version)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawCircleV(Vector2 center, float radius, Color color);
|
||||
|
||||
/// <summary>Draw circle outline</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -1468,11 +1529,21 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color);
|
||||
|
||||
/// <summary>Draw ellipse (Vector version)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawEllipseV(Vector2 center, float radiusH, float radiusV, Color color);
|
||||
|
||||
/// <summary>Draw ellipse outline</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color);
|
||||
|
||||
/// <summary>Draw ellipse outline (Vector version)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawEllipseLinesV(Vector2 center, float radiusH, float radiusV, Color color);
|
||||
|
||||
/// <summary>Draw ring</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -1812,6 +1883,11 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial Image LoadImageAnim(sbyte* fileName, int* frames);
|
||||
|
||||
/// <summary>Load image sequence from memory buffer</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial Image LoadImageAnimFromMemory(sbyte* fileType, byte* fileData, int dataSize, int* frames);
|
||||
|
||||
/// <summary>Load image from memory buffer, fileType refers to extension: i.e. ".png"</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -2372,6 +2448,11 @@ public static unsafe partial class Raylib
|
|||
|
||||
// Color/pixel related functions
|
||||
|
||||
/// <summary>Check if two colors are equal</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial CBool ColorIsEqual(Color col1, Color col2);
|
||||
|
||||
/// <summary>Get hexadecimal value for a Color (0xRRGGBBAA)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -2613,6 +2694,11 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial Vector2 MeasureTextEx(Font font, sbyte* text, float fontSize, float spacing);
|
||||
|
||||
/// <summary>Measure string size for Font</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial Vector2 MeasureTextCodepoints(Font font, int* codepoints, int length, float fontSize, float spacing);
|
||||
|
||||
/// <summary>
|
||||
/// Get glyph index position in font for a codepoint (unicode character), fallback to '?' if not found
|
||||
/// </summary>
|
||||
|
|
@ -2684,8 +2770,21 @@ public static unsafe partial class Raylib
|
|||
|
||||
|
||||
// Text strings management functions (no UTF-8 strings, only byte chars)
|
||||
// WARNING 1: Most of these functions use internal static buffers[], it's recommended to store returned data on user-side for re-use
|
||||
// WARNING 2: Some functions allocate memory internally for the returned strings, those strings must be freed by user using MemFree()
|
||||
// NOTE: Some strings allocate memory internally for returned strings, just be careful!
|
||||
|
||||
|
||||
/// <summary>Load text as separate lines ('\n')</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte** LoadTextLines(sbyte* text, int* count);
|
||||
|
||||
/// <summary>Unload text lines</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadTextLines(sbyte** text, int* lineCount);
|
||||
|
||||
/// <summary>Copy one string to another, returns bytes copied</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -2711,15 +2810,45 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* TextSubtext(sbyte* text, int position, int length);
|
||||
|
||||
/// <summary>Remove text spaces, concat words</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* TextRemoveSpaces(sbyte* text);
|
||||
|
||||
/// <summary>Get text between two strings</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* GetTextBetween(sbyte* text, sbyte* begin, sbyte* end);
|
||||
|
||||
/// <summary>Replace text string</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* TextReplace(sbyte* text, sbyte* search, sbyte* replacement);
|
||||
|
||||
/// <summary>Replace text string (WARNING: memory must be freed!)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* TextReplace(sbyte* text, sbyte* replace, sbyte* by);
|
||||
public static partial sbyte* TextReplaceAlloc(sbyte* text, sbyte* search, sbyte* replacement);
|
||||
|
||||
/// <summary>Replace text between two specific strings</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* TextReplaceBetween(sbyte* text, sbyte* start, sbyte* end, sbyte* replacement);
|
||||
|
||||
/// <summary>Replace text between two specific strings, (WARNING: memory must be freed!)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* TextReplaceBetweenAlloc(sbyte* text, sbyte* start, sbyte* end, sbyte* replacement);
|
||||
|
||||
/// <summary>Insert text in a position</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* TextInsert(sbyte* text, sbyte* insert, int position);
|
||||
|
||||
/// <summary>Insert text in a position (WARNING: memory must be freed!)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial sbyte* TextInsert(sbyte* text, sbyte* insert, int position);
|
||||
public static partial sbyte* TextInsertAlloc(sbyte* text, sbyte* insert, int position);
|
||||
|
||||
/// <summary>Join text strings with delimiter</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -3004,23 +3133,6 @@ public static unsafe partial class Raylib
|
|||
Color tint
|
||||
);
|
||||
|
||||
/// <summary>Draw a model as points</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawModelPoints(Model model, Vector3 position, float scale, Color tint);
|
||||
|
||||
/// <summary>Draw a model as points with extended parameters</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawModelPointsEx(
|
||||
Model model,
|
||||
Vector3 position,
|
||||
Vector3 rotationAxis,
|
||||
float rotationAngle,
|
||||
Vector3 scale,
|
||||
Color tint
|
||||
);
|
||||
|
||||
/// <summary>Draw bounding box (wires)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -3211,20 +3323,15 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial ModelAnimation* LoadModelAnimations(sbyte* fileName, int* animCount);
|
||||
|
||||
/// <summary>Update model animation pose (CPU)</summary>
|
||||
/// <summary>Update model animation pose (vertex buffers and bone matrices)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UpdateModelAnimation(Model model, ModelAnimation anim, int frame);
|
||||
public static partial void UpdateModelAnimation(Model model, ModelAnimation anim, float frame);
|
||||
|
||||
/// <summary>Update model animation mesh bone matrices (GPU skinning)</summary>
|
||||
/// <summary>Update model animation pose, blending two animations</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame);
|
||||
|
||||
/// <summary>Unload animation data</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadModelAnimation(ModelAnimation anim);
|
||||
public static partial void UpdateModelAnimationEx(Model model, ModelAnimation anim, float frame, ModelAnimation animB, float frameB, float blend);
|
||||
|
||||
/// <summary>Unload animation array data</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -3247,7 +3354,6 @@ public static unsafe partial class Raylib
|
|||
Vector3 center2,
|
||||
float radius2
|
||||
);
|
||||
|
||||
/// <summary>Detect collision between two bounding boxes</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -3421,7 +3527,7 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetSoundPitch(Sound sound, float pitch);
|
||||
|
||||
/// <summary>Set pan for a sound (0.5 is center)</summary>
|
||||
/// <summary>Set pan for a sound (-1.0 left, 0.0 center, 1.0 right)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetSoundPan(Sound sound, float pan);
|
||||
|
|
@ -3518,7 +3624,7 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetMusicPitch(Music music, float pitch);
|
||||
|
||||
/// <summary>Set pan for a music (0.5 is center)</summary>
|
||||
/// <summary>Set pan for a music (-1.0 left, 0.0 center, 1.0 right)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetMusicPan(Music music, float pan);
|
||||
|
|
@ -3596,7 +3702,7 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetAudioStreamPitch(AudioStream stream, float pitch);
|
||||
|
||||
/// <summary>Set pan for audio stream (0.5 is centered)</summary>
|
||||
/// <summary>Set pan for audio stream (-1.0 to 1.0 range, 0.0 is centered)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetAudioStreamPan(AudioStream stream, float pan);
|
||||
|
|
@ -3614,7 +3720,7 @@ public static unsafe partial class Raylib
|
|||
delegate* unmanaged[Cdecl]<void*, uint, void> callback
|
||||
);
|
||||
|
||||
/// <summary>Attach audio stream processor to stream</summary>
|
||||
/// <summary>Attach audio stream processor to stream, receives frames x 2 samples as 'float' (stereo)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void AttachAudioStreamProcessor(
|
||||
|
|
@ -3630,7 +3736,7 @@ public static unsafe partial class Raylib
|
|||
delegate* unmanaged[Cdecl]<void*, uint, void> processor
|
||||
);
|
||||
|
||||
/// <summary>Attach audio stream processor to the entire audio pipeline</summary>
|
||||
/// <summary>Attach audio stream processor to the entire audio pipeline, receives frames x 2 samples as 'float' (stereo)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void AttachAudioMixedProcessor(
|
||||
|
|
|
|||
|
|
@ -102,6 +102,11 @@ public static unsafe partial class Raymath
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial float Vector2DotProduct(Vector2 v1, Vector2 v2);
|
||||
|
||||
/// <summary>Calculate two vectors cross product</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial float Vector2CrossProduct(Vector2 v1, Vector2 v2);
|
||||
|
||||
/// <summary>Calculate distance between two vectors</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -113,8 +118,9 @@ public static unsafe partial class Raymath
|
|||
public static partial float Vector2DistanceSqr(Vector2 v1, Vector2 v2);
|
||||
|
||||
/// <summary>
|
||||
/// Calculate angle between two vectors
|
||||
/// NOTE: Angle is calculated from origin point (0, 0)
|
||||
/// Calculate the signed angle from v1 to v2, relative to the origin (0, 0)
|
||||
/// NOTE: Coordinate system convention: positive X right, positive Y down
|
||||
/// positive angles appear clockwise, and negative angles appear counterclockwise
|
||||
/// </summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -290,7 +296,7 @@ public static unsafe partial class Raymath
|
|||
/// <summary>Calculate angle between two vectors in XY and XZ</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial Vector2 Vector3Angle(Vector3 v1, Vector3 v2);
|
||||
public static partial float Vector3Angle(Vector3 v1, Vector3 v2);
|
||||
|
||||
/// <summary>Negate provided vector (invert direction)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -474,6 +480,13 @@ public static unsafe partial class Raymath
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial Matrix4x4 MatrixMultiply(Matrix4x4 left, Matrix4x4 right);
|
||||
|
||||
/// <summary>
|
||||
/// Multiply matrix components by value
|
||||
/// </summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial Matrix4x4 MatrixMultiplyValue(Matrix4x4 left, float value);
|
||||
|
||||
/// <summary>Get translation matrix</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -698,6 +711,14 @@ public static unsafe partial class Raymath
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int QuaternionEquals(Quaternion p, Quaternion q);
|
||||
|
||||
/// <summary>
|
||||
/// Compose a transformation matrix from rotational, translational and scaling components
|
||||
/// TODO: This function is not following raymath conventions defined in header: NOT self-contained
|
||||
/// </summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial Matrix4x4 MatrixCompose(Vector3 translation, Quaternion rotation, Vector3 scale);
|
||||
|
||||
/// <summary>Decompose a transformation matrix into its rotational, translational and scaling components</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ public static unsafe partial class Rlgl
|
|||
/// <summary>Blit active framebuffer to main framebuffer</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlBlitFramebuffer")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void BlitFramebuffer();
|
||||
public static partial void BlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask);
|
||||
|
||||
/// <summary>Bind framebuffer (FBO)</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlBindFramebuffer")]
|
||||
|
|
@ -462,16 +462,31 @@ public static unsafe partial class Rlgl
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void Scissor(int x, int y, int width, int height);
|
||||
|
||||
/// <summary>Enable wire mode</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlEnableWireMode")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void EnableWireMode();
|
||||
|
||||
/// <summary>Enable point mode</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlEnablePointMode")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void EnablePointMode();
|
||||
|
||||
/// <summary>Disable point mode</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlDisablePointMode")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DisablePointMode();
|
||||
|
||||
/// <summary>Set the point drawing size</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlSetPointSize")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetPointSize(float size);
|
||||
|
||||
/// <summary>Get the point drawing size</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlGetPointSize")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial float GetPointSize();
|
||||
|
||||
/// <summary>Enable wire mode</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlEnableWireMode")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void EnableWireMode();
|
||||
|
||||
/// <summary>Disable wire mode</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlDisableWireMode")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -569,11 +584,26 @@ public static unsafe partial class Rlgl
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void LoadExtensions(void* loader);
|
||||
|
||||
/// <summary>Get OpenGL procedure address</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlGetProcAddress")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void* GetProcAddress(sbyte* procName);
|
||||
|
||||
/// <summary>Get current OpenGL version</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlGetVersion")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial GlVersion GetVersion();
|
||||
|
||||
/// <summary>Set current framebuffer width</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlSetFramebufferWidth")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int SetFramebufferWidth(int width);
|
||||
|
||||
/// <summary>Set current framebuffer height</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlSetFramebufferHeight")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int SetFramebufferHeight(int height);
|
||||
|
||||
/// <summary>Get default framebuffer width</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlGetFramebufferWidth")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -811,36 +841,55 @@ public static unsafe partial class Rlgl
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadFramebuffer(uint id);
|
||||
|
||||
/// <summary>Copy framebuffer pixel data to internal buffer</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlCopyFramebuffer")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void CopyFramebuffer(int x, int y, int width, int height, int format, void* pixels);
|
||||
|
||||
/// <summary>Resize internal framebuffer</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlResizeFramebuffer")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void ResizeFramebuffer(int width, int height);
|
||||
|
||||
// Shaders management
|
||||
|
||||
/// <summary>Load (compile) shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlLoadShader")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial uint LoadShader(sbyte* vsCode, int type);
|
||||
|
||||
/// <summary>Load shader from code strings</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlLoadShaderCode")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial uint LoadShaderCode(sbyte* vsCode, sbyte* fsCode);
|
||||
|
||||
/// <summary>Compile custom shader and return shader id<br/>
|
||||
/// (type: VERTEX_SHADER, FRAGMENT_SHADER, COMPUTE_SHADER)</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlCompileShader")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial uint CompileShader(sbyte* shaderCode, int type);
|
||||
|
||||
/// <summary>Load custom shader program</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlLoadShaderProgram")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial uint LoadShaderProgram(uint vShaderId, uint fShaderId);
|
||||
public static partial uint LoadShaderProgram(sbyte* vsCode, sbyte* fsCode);
|
||||
|
||||
/// <summary>Load shader program, using already loaded shader ids</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlLoadShaderProgramEx")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial uint LoadShaderProgramEx(uint vsId, uint fsId);
|
||||
|
||||
/// <summary>Load compute shader program</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlLoadShaderProgramCompute")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial uint LoadShaderProgramCompute(uint csId);
|
||||
|
||||
|
||||
/// <summary>Unload shader, loaded with LoadShader()</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlUnloadShader")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadShader(uint id);
|
||||
|
||||
/// <summary>Unload shader program</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlUnloadShaderProgram")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadShaderProgram(uint id);
|
||||
|
||||
/// <summary>Get shader location uniform</summary>
|
||||
/// <summary>Get shader location uniform, requires shader program id</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlGetLocationUniform")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int GetLocationUniform(uint shaderId, sbyte* uniformName);
|
||||
|
||||
/// <summary>Get shader location attribute</summary>
|
||||
/// <summary>Get shader location attribute, requires shader program id</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlGetLocationAttrib")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int GetLocationAttrib(uint shaderId, sbyte* attribName);
|
||||
|
|
@ -873,11 +922,6 @@ public static unsafe partial class Rlgl
|
|||
|
||||
// Compute shader management
|
||||
|
||||
/// <summary>Load compute shader program</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlLoadComputeShaderProgram")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial uint LoadComputeShaderProgram(uint shaderId);
|
||||
|
||||
/// <summary>Dispatch compute shader (equivalent to *draw* for graphics pilepine)</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlComputeShaderDispatch")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
@ -976,12 +1020,12 @@ public static unsafe partial class Rlgl
|
|||
/// <summary>Set eyes projection matrices for stereo rendering</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlSetMatrixProjectionStereo")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetMatrixProjectionStereo(Matrix4x4 left, Matrix4x4 right);
|
||||
public static partial void SetMatrixProjectionStereo(Matrix4x4 right, Matrix4x4 left);
|
||||
|
||||
/// <summary>Set eyes view offsets matrices for stereo rendering</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlSetMatrixViewOffsetStereo")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void SetMatrixViewOffsetStereo(Matrix4x4 left, Matrix4x4 right);
|
||||
public static partial void SetMatrixViewOffsetStereo(Matrix4x4 right, Matrix4x4 left);
|
||||
|
||||
|
||||
// Quick and dirty cube/quad buffers load->draw->unload
|
||||
|
|
|
|||
Loading…
Reference in a new issue