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
|
|
@ -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