diff --git a/Raylib-cs/interop/Raylib.cs b/Raylib-cs/interop/Raylib.cs index 1810cf8..ffc777b 100644 --- a/Raylib-cs/interop/Raylib.cs +++ b/Raylib-cs/interop/Raylib.cs @@ -1336,7 +1336,7 @@ public static unsafe partial class Raylib /// Load image from SVG file data or string with specified size [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern Image LoadImageSvg(char *fileNameOrString, int width, int height); + public static extern Image LoadImageSvg(sbyte* fileName, int width, int height); /// Load image sequence from file (frames appended to image.data) [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] @@ -1368,7 +1368,7 @@ public static unsafe partial class Raylib /// Export image to memory buffer [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern char* ExportImageToMemory(Image image, char *fileType, int *fileSize); + public static extern char* ExportImageToMemory(Image image, sbyte* fileType, int *fileSize); /// Export image as code file defining an array of bytes [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)] diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index 0cb16a2..c3d6978 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -83,6 +83,15 @@ public static unsafe partial class Raylib return GetShaderLocationAttrib(shader, str1.AsPointer()); } + /// Unload random values sequence + public static void UnloadRandomSequence(out int sequence) + { + fixed (int* p = &sequence) + { + UnloadRandomSequence(p); + } + } + /// Takes a screenshot of current screen (saved a .png) public static void TakeScreenshot(string fileName) { @@ -119,6 +128,13 @@ public static unsafe partial class Raylib return LoadImageRaw(str1.AsPointer(), width, height, format, headerSize); } + /// Load image sequence from file (frames appended to image.data) + public static Image LoadImageSvg(string fileName, int width, int height) + { + using var str1 = fileName.ToAnsiBuffer(); + return LoadImageSvg(str1.AsPointer(), width, height); + } + /// Load image sequence from file (frames appended to image.data) public static Image LoadImageAnim(string fileName, out int frames) { @@ -571,6 +587,15 @@ public static unsafe partial class Raylib } } + /// Rotate image by input angle in degrees (-359 to 359) + public static void ImageRotate(ref Image image, int degrees) + { + fixed (Image* p = &image) + { + ImageRotate(p, degrees); + } + } + /// Rotate image clockwise 90deg public static void ImageRotateCW(ref Image image) { @@ -840,12 +865,12 @@ public static unsafe partial class Raylib } /// Load font from file with extended parameters - public static Font LoadFontEx(string fileName, int fontSize, int[] fontChars, int glyphCount) + public static Font LoadFontEx(string fileName, int fontSize, int[] codepoints, int codepointCount) { using var str1 = fileName.ToAnsiBuffer(); - fixed (int* p = fontChars) + fixed (int* p = codepoints) { - return LoadFontEx(str1.AsPointer(), fontSize, p, glyphCount); + return LoadFontEx(str1.AsPointer(), fontSize, p, codepointCount); } } @@ -856,14 +881,14 @@ public static unsafe partial class Raylib string fileType, byte[] fileData, int fontSize, - int[] fontChars, - int glyphCount + int[] codepoints, + int codepointCount ) { using var fileTypeNative = fileType.ToAnsiBuffer(); fixed (byte* fileDataNative = fileData) { - fixed (int* fontCharsNative = fontChars) + fixed (int* fontCharsNative = codepoints) { Font font = LoadFontFromMemory( fileTypeNative.AsPointer(), @@ -871,7 +896,7 @@ public static unsafe partial class Raylib fileData.Length, fontSize, fontCharsNative, - glyphCount + codepointCount ); return font; @@ -979,6 +1004,51 @@ public static unsafe partial class Raylib } } + /// Draw spline: Linear, minimum 2 points + public static void DrawSplineLinear(Vector2[] points, int pointCount, float thick, Color color) + { + fixed (Vector2* p = points) + { + DrawSplineLinear(p, pointCount, thick, color); + } + } + + /// Draw spline: B-Spline, minimum 4 points + public static void DrawSplineBasis(Vector2[] points, int pointCount, float thick, Color color) + { + fixed (Vector2* p = points) + { + DrawSplineBasis(p, pointCount, thick, color); + } + } + + /// Draw spline: Catmull-Rom, minimum 4 points + public static void DrawSplineCatmullRom(Vector2[] points, int pointCount, float thick, Color color) + { + fixed (Vector2* p = points) + { + DrawSplineCatmullRom(p, pointCount, thick, color); + } + } + + /// Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] + public static void DrawSplineBezierQuadratic(Vector2[] points, int pointCount, float thick, Color color) + { + fixed (Vector2* p = points) + { + DrawSplineBezierQuadratic(p, pointCount, thick, color); + } + } + + /// Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] + public static void DrawSplineBezierCubic(Vector2[] points, int pointCount, float thick, Color color) + { + fixed (Vector2* p = points) + { + DrawSplineBezierCubic(p, pointCount, thick, color); + } + } + /// Draw text (using default font) public static void DrawText(string text, int posX, int posY, int fontSize, Color color) {