Updated target to Raylib 6 + synced invoke called with the changes in C. [WARNING: Breaking changes!]
This commit is contained in:
parent
1b890169c5
commit
2a86968da0
11 changed files with 293 additions and 139 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<StartupObject>Examples.Program</StartupObject>
|
<StartupObject>Examples.Program</StartupObject>
|
||||||
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>
|
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="ConfigureNative">
|
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="ConfigureNative">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
<DebugType>none</DebugType>
|
<DebugType>none</DebugType>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
<TargetFrameworks>net10.0</TargetFrameworks>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<LangVersion>12</LangVersion>
|
<LangVersion>12</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetRaylibTag>5.5</TargetRaylibTag>
|
<TargetRaylibTag>6.0</TargetRaylibTag>
|
||||||
<Version>8.0.0</Version>
|
<Version>8.0.0</Version>
|
||||||
<PackageVersion>8.0.0</PackageVersion>
|
<PackageVersion>8.0.0</PackageVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
|
||||||
<EnableDefaultItems>false</EnableDefaultItems>
|
<EnableDefaultItems>false</EnableDefaultItems>
|
||||||
<AssemblyName>Raylib-cs</AssemblyName>
|
<AssemblyName>Raylib-cs</AssemblyName>
|
||||||
<RootNamespace>Raylib_cs</RootNamespace>
|
<RootNamespace>Raylib_cs</RootNamespace>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public static unsafe partial class Raylib
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string NativeLibName = "raylib";
|
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 DEG2RAD = MathF.PI / 180.0f;
|
||||||
public const float RAD2DEG = 180.0f / MathF.PI;
|
public const float RAD2DEG = 180.0f / MathF.PI;
|
||||||
|
|
@ -701,6 +701,8 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void UnloadRandomSequence(int* sequence);
|
public static partial void UnloadRandomSequence(int* sequence);
|
||||||
|
|
||||||
|
// Misc. functions
|
||||||
|
|
||||||
/// <summary>Takes a screenshot of current screen (saved a .png)</summary>
|
/// <summary>Takes a screenshot of current screen (saved a .png)</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -711,6 +713,13 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetConfigFlags(ConfigFlags flags);
|
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>
|
/// <summary>Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -721,6 +730,8 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetTraceLogLevel(TraceLogLevel logLevel);
|
public static partial void SetTraceLogLevel(TraceLogLevel logLevel);
|
||||||
|
|
||||||
|
// Memory management, using internal allocators
|
||||||
|
|
||||||
/// <summary>Internal memory allocator</summary>
|
/// <summary>Internal memory allocator</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -745,29 +756,6 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetTraceLogCallback(delegate* unmanaged[Cdecl]<int, sbyte*, sbyte*, void> callback);
|
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
|
// Files management functions
|
||||||
|
|
||||||
/// <summary>Load file data as byte array (read)</summary>
|
/// <summary>Load file data as byte array (read)</summary>
|
||||||
|
|
@ -790,27 +778,81 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial CBool ExportDataAsCode(byte* data, int dataSize, sbyte* fileName);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial sbyte* LoadFileText(sbyte* fileName);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void UnloadFileText(sbyte* text);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial CBool SaveFileText(sbyte* fileName, sbyte* text);
|
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 CBool FileRename(sbyte* fileName, sbyte* fileRename);
|
||||||
|
|
||||||
|
/// <summary>Remove file (if exists)</summary>
|
||||||
|
[LibraryImport(NativeLibName)]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial CBool 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 CBool 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 CBool FileMove(sbyte* srcPath, sbyte* dstPath);
|
||||||
|
|
||||||
|
/// <summary>Replace text in an existing file</summary>
|
||||||
|
[LibraryImport(NativeLibName)]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial CBool FileTextReplace(sbyte* fileName, sbyte* search, sbyte* replacement);
|
||||||
|
|
||||||
|
/// <summary>Find text in existing file</summary>
|
||||||
|
[LibraryImport(NativeLibName)]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial CBool FileTextFindIndex(sbyte* fileName, sbyte* search);
|
||||||
|
|
||||||
|
/// <summary>Check if file exists</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial CBool FileExists(sbyte* fileName);
|
public static partial CBool FileExists(sbyte* fileName);
|
||||||
|
|
||||||
// Check if a directory path exists
|
/// <summary>Check if a directory path exists</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial CBool DirectoryExists(sbyte* dirPath);
|
public static partial CBool DirectoryExists(sbyte* dirPath);
|
||||||
|
|
@ -825,6 +867,11 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial int GetFileLength(sbyte* fileName);
|
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 long GetFileModTime(sbyte* fileName);
|
||||||
|
|
||||||
/// <summary>Get pointer to extension for a filename string (includes dot: '.png')</summary>
|
/// <summary>Get pointer to extension for a filename string (includes dot: '.png')</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -865,6 +912,21 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial int MakeDirectory(sbyte* dirPath);
|
public static partial int MakeDirectory(sbyte* dirPath);
|
||||||
|
|
||||||
|
/// <summary>Change working directory, return true on success</summary>
|
||||||
|
[LibraryImport(NativeLibName)]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial CBool ChangeDirectory(sbyte* dirPath);
|
||||||
|
|
||||||
|
/// <summary>Check if a given path is a file or a directory</summary>
|
||||||
|
[LibraryImport(NativeLibName)]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial CBool IsPathFile(sbyte* path);
|
||||||
|
|
||||||
|
/// <summary>Check if fileName is valid for the platform/OS</summary>
|
||||||
|
[LibraryImport(NativeLibName)]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial CBool IsFileNameValid(sbyte* fileName);
|
||||||
|
|
||||||
/// <summary>Load directory filepaths</summary>
|
/// <summary>Load directory filepaths</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -880,21 +942,6 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void UnloadDirectoryFiles(FilePathList files);
|
public static partial void UnloadDirectoryFiles(FilePathList files);
|
||||||
|
|
||||||
/// <summary>Check if a given path is a file or a directory</summary>
|
|
||||||
[LibraryImport(NativeLibName)]
|
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
|
||||||
public static partial CBool IsPathFile(sbyte* path);
|
|
||||||
|
|
||||||
/// <summary>Check if fileName is valid for the platform/OS</summary>
|
|
||||||
[LibraryImport(NativeLibName)]
|
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
|
||||||
public static partial CBool IsFileNameValid(sbyte* fileName);
|
|
||||||
|
|
||||||
/// <summary>Change working directory, return true on success</summary>
|
|
||||||
[LibraryImport(NativeLibName)]
|
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
|
||||||
public static partial CBool ChangeDirectory(sbyte* dir);
|
|
||||||
|
|
||||||
/// <summary>Check if a file has been dropped into window</summary>
|
/// <summary>Check if a file has been dropped into window</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -910,11 +957,15 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void UnloadDroppedFiles(FilePathList files);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial long GetFileModTime(sbyte* fileName);
|
public static partial FilePathList GetDirectoryFileCount(sbyte* dirPath);
|
||||||
|
|
||||||
|
/// <summary>Get the file count in a directory</summary>
|
||||||
|
[LibraryImport(NativeLibName)]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial FilePathList GetDirectoryFileCountEx(sbyte* dirPath, sbyte* filter, CBool scanSubdirs);
|
||||||
|
|
||||||
// Compression/Encoding functionality
|
// Compression/Encoding functionality
|
||||||
|
|
||||||
|
|
@ -953,10 +1004,10 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial uint* ComputeSHA1(byte* data, int dataSize);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void OpenURL(sbyte* url);
|
public static partial uint* ComputeSHA256(byte* data, int dataSize);
|
||||||
|
|
||||||
// Automation events functionality
|
// Automation events functionality
|
||||||
|
|
||||||
|
|
@ -1031,11 +1082,6 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial CBool IsKeyUp(KeyboardKey key);
|
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>
|
/// <summary>
|
||||||
/// 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
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -1050,6 +1096,16 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial int GetCharPressed();
|
public static partial int GetCharPressed();
|
||||||
|
|
||||||
|
/// <summary>Get gamepad internal name id</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
|
// Input-related functions: gamepads
|
||||||
|
|
||||||
|
|
@ -1398,21 +1454,38 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);
|
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>
|
/// <summary>Draw lines sequence</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void DrawLineStrip(Vector2* points, int pointCount, Color color);
|
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 color-filled circle</summary>
|
/// <summary>Draw a color-filled circle</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void DrawCircle(int centerX, int centerY, float radius, Color color);
|
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(
|
||||||
|
int centerX,
|
||||||
|
int centerY,
|
||||||
|
float radius,
|
||||||
|
Color inner,
|
||||||
|
Color outer
|
||||||
|
);
|
||||||
|
|
||||||
/// <summary>Draw a piece of a circle</summary>
|
/// <summary>Draw a piece of a circle</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -1437,22 +1510,6 @@ public static unsafe partial class Raylib
|
||||||
Color color
|
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>
|
/// <summary>Draw circle outline</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -1468,11 +1525,21 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void DrawEllipse(int centerX, int centerY, float radiusH, float radiusV, Color color);
|
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>
|
/// <summary>Draw ellipse outline</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void DrawEllipseLines(int centerX, int centerY, float radiusH, float radiusV, Color color);
|
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>
|
/// <summary>Draw ring</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -2372,6 +2439,11 @@ public static unsafe partial class Raylib
|
||||||
|
|
||||||
// Color/pixel related functions
|
// 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>
|
/// <summary>Get hexadecimal value for a Color (0xRRGGBBAA)</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -2684,8 +2756,21 @@ public static unsafe partial class Raylib
|
||||||
|
|
||||||
|
|
||||||
// Text strings management functions (no UTF-8 strings, only byte chars)
|
// 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!
|
// 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>
|
/// <summary>Copy one string to another, returns bytes copied</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -2711,15 +2796,35 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial sbyte* TextSubtext(sbyte* text, int position, int length);
|
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>
|
/// <summary>Replace text string (WARNING: memory must be freed!)</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[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>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>
|
/// <summary>Insert text in a position (WARNING: memory must be freed!)</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[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>
|
/// <summary>Join text strings with delimiter</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
|
|
@ -3004,23 +3109,6 @@ public static unsafe partial class Raylib
|
||||||
Color tint
|
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>
|
/// <summary>Draw bounding box (wires)</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -3211,15 +3299,15 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial ModelAnimation* LoadModelAnimations(sbyte* fileName, int* animCount);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame);
|
public static partial void UpdateModelAnimationEx(Model model, ModelAnimation anim, float frame, ModelAnimation animB, float frameB, float blend);
|
||||||
|
|
||||||
/// <summary>Unload animation data</summary>
|
/// <summary>Unload animation data</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
|
|
@ -3247,7 +3335,6 @@ public static unsafe partial class Raylib
|
||||||
Vector3 center2,
|
Vector3 center2,
|
||||||
float radius2
|
float radius2
|
||||||
);
|
);
|
||||||
|
|
||||||
/// <summary>Detect collision between two bounding boxes</summary>
|
/// <summary>Detect collision between two bounding boxes</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -3421,7 +3508,7 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetSoundPitch(Sound sound, float pitch);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetSoundPan(Sound sound, float pan);
|
public static partial void SetSoundPan(Sound sound, float pan);
|
||||||
|
|
@ -3518,7 +3605,7 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetMusicPitch(Music music, float pitch);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetMusicPan(Music music, float pan);
|
public static partial void SetMusicPan(Music music, float pan);
|
||||||
|
|
@ -3596,7 +3683,7 @@ public static unsafe partial class Raylib
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetAudioStreamPitch(AudioStream stream, float pitch);
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void SetAudioStreamPan(AudioStream stream, float pan);
|
public static partial void SetAudioStreamPan(AudioStream stream, float pan);
|
||||||
|
|
@ -3614,7 +3701,7 @@ public static unsafe partial class Raylib
|
||||||
delegate* unmanaged[Cdecl]<void*, uint, void> callback
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void AttachAudioStreamProcessor(
|
public static partial void AttachAudioStreamProcessor(
|
||||||
|
|
@ -3630,7 +3717,7 @@ public static unsafe partial class Raylib
|
||||||
delegate* unmanaged[Cdecl]<void*, uint, void> processor
|
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)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void AttachAudioMixedProcessor(
|
public static partial void AttachAudioMixedProcessor(
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,11 @@ public static unsafe partial class Raymath
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial float Vector2DotProduct(Vector2 v1, Vector2 v2);
|
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>
|
/// <summary>Calculate distance between two vectors</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -113,8 +118,9 @@ public static unsafe partial class Raymath
|
||||||
public static partial float Vector2DistanceSqr(Vector2 v1, Vector2 v2);
|
public static partial float Vector2DistanceSqr(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculate angle between two vectors
|
/// Calculate the signed angle from v1 to v2, relative to the origin (0, 0)
|
||||||
/// NOTE: Angle is calculated from origin point (0, 0)
|
/// NOTE: Coordinate system convention: positive X right, positive Y down
|
||||||
|
/// positive angles appear clockwise, and negative angles appear counterclockwise
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -474,6 +480,13 @@ public static unsafe partial class Raymath
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial Matrix4x4 MatrixMultiply(Matrix4x4 left, Matrix4x4 right);
|
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>
|
/// <summary>Get translation matrix</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -698,6 +711,14 @@ public static unsafe partial class Raymath
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial int QuaternionEquals(Quaternion p, Quaternion q);
|
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>
|
/// <summary>Decompose a transformation matrix into its rotational, translational and scaling components</summary>
|
||||||
[LibraryImport(NativeLibName)]
|
[LibraryImport(NativeLibName)]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
|
||||||
|
|
@ -462,16 +462,31 @@ public static unsafe partial class Rlgl
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void Scissor(int x, int y, int width, int height);
|
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>
|
/// <summary>Enable point mode</summary>
|
||||||
[LibraryImport(NativeLibName, EntryPoint = "rlEnablePointMode")]
|
[LibraryImport(NativeLibName, EntryPoint = "rlEnablePointMode")]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void EnablePointMode();
|
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>Set the point drawing size</summary>
|
||||||
|
[LibraryImport(NativeLibName, EntryPoint = "rlGetPointSize")]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial float GetPointSize();
|
||||||
|
|
||||||
|
/// <summary>Disable wire mode</summary>
|
||||||
|
[LibraryImport(NativeLibName, EntryPoint = "rlEnableWireMode")]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial void EnableWireMode();
|
||||||
|
|
||||||
/// <summary>Disable wire mode</summary>
|
/// <summary>Disable wire mode</summary>
|
||||||
[LibraryImport(NativeLibName, EntryPoint = "rlDisableWireMode")]
|
[LibraryImport(NativeLibName, EntryPoint = "rlDisableWireMode")]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -569,6 +584,11 @@ public static unsafe partial class Rlgl
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void LoadExtensions(void* loader);
|
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>
|
/// <summary>Get current OpenGL version</summary>
|
||||||
[LibraryImport(NativeLibName, EntryPoint = "rlGetVersion")]
|
[LibraryImport(NativeLibName, EntryPoint = "rlGetVersion")]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
@ -811,24 +831,43 @@ public static unsafe partial class Rlgl
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
public static partial void UnloadFramebuffer(uint id);
|
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 rlCopyFramebuffer(int x, int y, int width, int height, int format, void* pixels);
|
||||||
|
|
||||||
|
/// <summary>Copy framebuffer pixel data to internal buffer</summary>
|
||||||
|
[LibraryImport(NativeLibName, EntryPoint = "rlResizeFramebuffer")]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial void rlResizeFramebuffer(int width, int height);
|
||||||
|
|
||||||
// Shaders management
|
// 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>
|
/// <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")]
|
[LibraryImport(NativeLibName, EntryPoint = "rlLoadShaderProgram")]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[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 from code strings</summary>
|
||||||
|
[LibraryImport(NativeLibName, EntryPoint = "rlLoadShaderProgramEx")]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial uint LoadShaderProgramEx(uint vsId, uint fsId);
|
||||||
|
|
||||||
|
/// <summary>Load shader from code strings</summary>
|
||||||
|
[LibraryImport(NativeLibName, EntryPoint = "rlLoadShaderProgramCompute")]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial uint LoadShaderProgramCompute(uint csId);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>Unload shader program</summary>
|
||||||
|
[LibraryImport(NativeLibName, EntryPoint = "rlUnloadShader")]
|
||||||
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
public static partial void UnloadShader(uint id);
|
||||||
|
|
||||||
/// <summary>Unload shader program</summary>
|
/// <summary>Unload shader program</summary>
|
||||||
[LibraryImport(NativeLibName, EntryPoint = "rlUnloadShaderProgram")]
|
[LibraryImport(NativeLibName, EntryPoint = "rlUnloadShaderProgram")]
|
||||||
|
|
@ -873,11 +912,6 @@ public static unsafe partial class Rlgl
|
||||||
|
|
||||||
// Compute shader management
|
// 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>
|
/// <summary>Dispatch compute shader (equivalent to *draw* for graphics pilepine)</summary>
|
||||||
[LibraryImport(NativeLibName, EntryPoint = "rlComputeShaderDispatch")]
|
[LibraryImport(NativeLibName, EntryPoint = "rlComputeShaderDispatch")]
|
||||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||||
|
|
|
||||||
|
|
@ -181,38 +181,23 @@ public unsafe struct Mesh
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Animation vertex data
|
#region Skin data for animation
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Animated vertex positions (after bones transformations)
|
/// Number of bones (MAX: 256 bones)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float* AnimVertices = default;
|
public int BoneCount;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Animated normals (after bones transformations)
|
|
||||||
/// </summary>
|
|
||||||
public float* AnimNormals = default;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Vertex bone ids, up to 4 bones influence by vertex (skinning)
|
/// Vertex bone ids, up to 4 bones influence by vertex (skinning)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public byte* BoneIds = default;
|
public byte* boneIndices = default;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Vertex bone weight, up to 4 bones influence by vertex (skinning)
|
/// Vertex bone weight, up to 4 bones influence by vertex (skinning)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float* BoneWeights = default;
|
public float* BoneWeights = default;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bones animated transformation matrices
|
|
||||||
/// </summary>
|
|
||||||
public Matrix4x4* BoneMatrices = default;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Number of bones
|
|
||||||
/// </summary>
|
|
||||||
public int BoneCount;
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region OpenGL identifiers
|
#region OpenGL identifiers
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,32 @@ public unsafe struct BoneInfo
|
||||||
public int Parent;
|
public int Parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Skeleton, animation bones hierarchy
|
||||||
|
/// </summary>
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public unsafe struct ModelSkeleton
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Number of bones
|
||||||
|
/// </summary>
|
||||||
|
public int BoneCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bones information (skeleton)
|
||||||
|
/// </summary>
|
||||||
|
public BoneInfo* Bones;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bones base transformation (Transform[])
|
||||||
|
/// </summary>
|
||||||
|
public Transform* ModelAnimPose;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note:
|
||||||
|
// Anim pose, an array of Transform[]
|
||||||
|
// typedef Transform *ModelAnimPose; It's just an pointer array.
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Model type
|
/// Model type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ public enum ShaderLocationIndex
|
||||||
MapBrdf,
|
MapBrdf,
|
||||||
VertexBoneIds,
|
VertexBoneIds,
|
||||||
VertexBoneWeights,
|
VertexBoneWeights,
|
||||||
BoneMatrices,
|
BoneTransforms,
|
||||||
|
BoneInstanceTransform,
|
||||||
|
|
||||||
MapDiffuse = MapAlbedo,
|
MapDiffuse = MapAlbedo,
|
||||||
MapSpecular = MapMetalness,
|
MapSpecular = MapMetalness,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue