Fixed additional pinvokes to match with the new raylib bindings. [Warning breaking changes!]
This commit is contained in:
parent
ce3a7da69b
commit
62988c4ff1
7 changed files with 52 additions and 26 deletions
|
|
@ -5,7 +5,7 @@
|
|||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<StartupObject>Examples.Program</StartupObject>
|
||||
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>
|
||||
<LangVersion>12</LangVersion>
|
||||
<LangVersion>default</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class ShapesTextures
|
|||
DrawText("USING DEFAULT SHADER", 20, 40, 10, Color.Red);
|
||||
|
||||
DrawCircle(80, 120, 35, Color.DarkBlue);
|
||||
DrawCircleGradient(80, 220, 60, Color.Green, Color.SkyBlue);
|
||||
DrawCircleGradient(new Vector2(80, 220), 60, Color.Green, Color.SkyBlue);
|
||||
DrawCircleLines(80, 340, 80, Color.DarkBlue);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class BasicShapes
|
|||
DrawLine(18, 42, screenWidth - 18, 42, Color.Black);
|
||||
|
||||
DrawCircle(screenWidth / 4, 120, 35, Color.DarkBlue);
|
||||
DrawCircleGradient(screenWidth / 4, 220, 60, Color.Green, Color.SkyBlue);
|
||||
DrawCircleGradient(new Vector2(screenWidth / 4, 220), 60, Color.Green, Color.SkyBlue);
|
||||
DrawCircleLines(screenWidth / 4, 340, 80, Color.DarkBlue);
|
||||
|
||||
DrawRectangle(screenWidth / 4 * 2 - 60, 100, 120, 60, Color.Red);
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
@ -870,7 +870,7 @@ public static unsafe partial class Raylib
|
|||
/// <summary>Get file modification time (last write time)</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial long GetFileModTime(sbyte* fileName);
|
||||
public static partial CLong GetFileModTime(sbyte* fileName);
|
||||
|
||||
/// <summary>Get pointer to extension for a filename string (includes dot: '.png')</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
|
|
@ -930,7 +930,7 @@ public static unsafe partial class Raylib
|
|||
/// <summary>Load directory filepaths</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial FilePathList LoadDirectoryFiles(sbyte* dirPath, int* count);
|
||||
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)]
|
||||
|
|
@ -960,12 +960,12 @@ public static unsafe partial class Raylib
|
|||
/// <summary>Get the file count in a directory</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial FilePathList GetDirectoryFileCount(sbyte* dirPath);
|
||||
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 FilePathList GetDirectoryFileCountEx(sbyte* dirPath, sbyte* filter, CBool scanSubdirs);
|
||||
public static partial int GetDirectoryFileCountEx(sbyte* dirPath, sbyte* filter, CBool scanSubdirs);
|
||||
|
||||
// Compression/Encoding functionality
|
||||
|
||||
|
|
@ -1464,6 +1464,11 @@ public static unsafe partial class Raylib
|
|||
[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)])]
|
||||
|
|
@ -1479,8 +1484,7 @@ public static unsafe partial class Raylib
|
|||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void DrawCircleGradient(
|
||||
int centerX,
|
||||
int centerY,
|
||||
Vector2 center,
|
||||
float radius,
|
||||
Color inner,
|
||||
Color outer
|
||||
|
|
@ -1879,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* fileName, sbyte* 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)])]
|
||||
|
|
@ -2685,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>
|
||||
|
|
@ -2816,6 +2830,16 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
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)])]
|
||||
|
|
@ -3309,11 +3333,6 @@ public static unsafe partial class Raylib
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UpdateModelAnimationEx(Model model, ModelAnimation anim, float frame, ModelAnimation animB, float frameB, float blend);
|
||||
|
||||
/// <summary>Unload animation data</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial void UnloadModelAnimation(ModelAnimation anim);
|
||||
|
||||
/// <summary>Unload animation array data</summary>
|
||||
[LibraryImport(NativeLibName)]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
|
|
|
|||
|
|
@ -296,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)]
|
||||
|
|
|
|||
|
|
@ -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")]
|
||||
|
|
@ -594,6 +594,16 @@ public static unsafe partial class Rlgl
|
|||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial GlVersion GetVersion();
|
||||
|
||||
/// <summary>Get default framebuffer width</summary>
|
||||
[LibraryImport(NativeLibName, EntryPoint = "rlSetFramebufferWidth")]
|
||||
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
|
||||
public static partial int SetFramebufferWidth(int width);
|
||||
|
||||
/// <summary>Get default framebuffer width</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)])]
|
||||
|
|
@ -1010,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
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public static unsafe partial class Raylib
|
|||
public static long GetFileModTime(string fileName)
|
||||
{
|
||||
using AnsiBuffer str1 = fileName.ToAnsiBuffer();
|
||||
return GetFileModTime(str1.AsPointer());
|
||||
return GetFileModTime(str1.AsPointer()).Value;
|
||||
}
|
||||
|
||||
/// <summary>Load image from file into CPU memory (RAM)</summary>
|
||||
|
|
@ -1699,13 +1699,10 @@ public static unsafe partial class Raylib
|
|||
}
|
||||
|
||||
/// <summary>Load directory filepaths</summary>
|
||||
public static FilePathList LoadDirectoryFiles(string dirPath, out int count)
|
||||
public static FilePathList LoadDirectoryFiles(string dirPath)
|
||||
{
|
||||
using AnsiBuffer dirBuffer = dirPath.ToAnsiBuffer();
|
||||
int c = 0;
|
||||
var result = LoadDirectoryFiles(dirBuffer.AsPointer(), &c);
|
||||
count = c;
|
||||
return result;
|
||||
return LoadDirectoryFiles(dirBuffer.AsPointer());
|
||||
}
|
||||
|
||||
/// <summary>Load directory filepaths with extension filtering and subdir scan; some filters available: "*.*", "FILES*", "DIRS*"</summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue