Watch
2
0
Fork
You've already forked raylib-cs
0

Ordering readings

Added "SaveFileData" overload to "Raylib.Utils"
Moved "SaveFileText" from "RaylibExtensions" to "Raylib.Utils"
Moved "LoadFileText" from "RaylibExtensions" to "Raylib.Utils"
Raymath's const "NativeLibName" is now referencing to "Raylib.NativeLibName"
Color constructors are more readable
Added "Dimensions" property to "Image"
Changed all the "var" for explicit types on the "Logging" class
Changed "Int64" for "long" on CBool, and using constructor on the operators instead setting the value manually
Added indexer to "FilePathLists"
Changed all "var" for explicit types on "Utf8Buffer"
New "GetRandomSequence" method overloads in "Raylib.Utils" acepting "int" and "float"
This commit is contained in:
Matorio 2025-07-15 17:17:41 -05:00
commit 9811c0d129
11 changed files with 140 additions and 60 deletions

View file

@ -1,7 +1,7 @@
using System;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Numerics;
using System.Security;
using System;
namespace Raylib_cs;

View file

@ -6,23 +6,6 @@ namespace Raylib_cs;
public static class RaylibExtensions
{
public static unsafe void SaveFileText(string fileName, string text)
{
using AnsiBuffer fileBuffer = fileName.ToAnsiBuffer();
using AnsiBuffer textBuffer = text.ToAnsiBuffer();
Raylib.SaveFileText(fileBuffer.AsPointer(), textBuffer.AsPointer());
}
public static unsafe string LoadFileText(string fileName)
{
using AnsiBuffer nameBuffer = fileName.ToAnsiBuffer();
sbyte* data = Raylib.LoadFileText(nameBuffer.AsPointer());
//string text = new string(data);
string text = System.Runtime.InteropServices.Marshal.PtrToStringUTF8((System.IntPtr)data);
Raylib.UnloadFileText(data);
return text;
}
#region Rectangle
public static void Draw(this Rectangle rectangle, Color color)

View file

@ -21,7 +21,7 @@ public static unsafe partial class Raymath
/// <summary>
/// Used by DllImport to load the native library
/// </summary>
public const string NativeLibName = "raylib";
public const string NativeLibName = Raylib.NativeLibName;
/// <summary>Clamp float value</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]