diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs index bd35710..0072102 100644 --- a/Raylib-cs/Raylib.cs +++ b/Raylib-cs/Raylib.cs @@ -480,15 +480,15 @@ namespace Raylib_cs // Load text data from file (read), returns a '\0' terminated string [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern char *LoadFileText(sbyte* fileName); + public static extern char* LoadFileText(sbyte* fileName); // Unload file text data allocated by LoadFileText() [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void UnloadFileText(char *text); + public static extern void UnloadFileText(char* text); // Save text data to file (write), string must be '\0' terminated, returns true on success [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern CBool SaveFileText(sbyte* fileName, char *text); + public static extern CBool SaveFileText(sbyte* fileName, char* text); // Check if file exists [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] @@ -504,39 +504,39 @@ namespace Raylib_cs /// Get pointer to extension for a filename string (includes dot: '.png') [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern sbyte* GetFileExtension(sbyte* fileName); - + public static extern sbyte* GetFileExtension(sbyte* fileName); + /// Get pointer to filename for a path string [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern sbyte* GetFileName(sbyte* filePath); - + public static extern sbyte* GetFileName(sbyte* filePath); + /// Get filename string without extension (uses static string) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern sbyte* GetFileNameWithoutExt(sbyte* filePath); - + public static extern sbyte* GetFileNameWithoutExt(sbyte* filePath); + /// Get full path for a given fileName with path (uses static string) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern sbyte* GetDirectoryPath(sbyte* filePath); - + public static extern sbyte* GetDirectoryPath(sbyte* filePath); + /// Get previous directory path for a given path (uses static string) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern sbyte* GetPrevDirectoryPath(sbyte* dirPath); - + public static extern sbyte* GetPrevDirectoryPath(sbyte* dirPath); + /// Get current working directory (uses static string) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern sbyte* GetWorkingDirectory(); - + public static extern sbyte* GetWorkingDirectory(); + /// Get filenames in a directory path (memory should be freed) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern char **GetDirectoryFiles(sbyte* dirPath, int *count); - + public static extern char** GetDirectoryFiles(sbyte* dirPath, int* count); + /// Clear directory files paths buffers (free memory) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void ClearDirectoryFiles(); - + public static extern void ClearDirectoryFiles(); + /// Change working directory, return true on success [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern CBool ChangeDirectory(sbyte* dir); + public static extern CBool ChangeDirectory(sbyte* dir); /// Check if a file has been dropped into window [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] diff --git a/Raylib-cs/types/BoundingBox.cs b/Raylib-cs/types/BoundingBox.cs new file mode 100644 index 0000000..66424ad --- /dev/null +++ b/Raylib-cs/types/BoundingBox.cs @@ -0,0 +1,26 @@ +using System.Numerics; +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// Bounding box type + [StructLayout(LayoutKind.Sequential)] + public struct BoundingBox + { + /// + /// Minimum vertex box-corner + /// + public Vector3 min; + + /// + /// Maximum vertex box-corner + /// + public Vector3 max; + + public BoundingBox(Vector3 min, Vector3 max) + { + this.min = min; + this.max = max; + } + } +} diff --git a/Raylib-cs/types/Shapes.cs b/Raylib-cs/types/Ray.cs similarity index 53% rename from Raylib-cs/types/Shapes.cs rename to Raylib-cs/types/Ray.cs index abb1316..36b196d 100644 --- a/Raylib-cs/types/Shapes.cs +++ b/Raylib-cs/types/Ray.cs @@ -3,52 +3,6 @@ using System.Runtime.InteropServices; namespace Raylib_cs { - /// - /// Rectangle type - /// - [StructLayout(LayoutKind.Sequential)] - public struct Rectangle - { - public float x; - public float y; - public float width; - public float height; - - public Rectangle(float x, float y, float width, float height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - - public override string ToString() - { - return $"{{X:{x} Y:{y} Width:{width} Height:{height}}}"; - } - } - - /// Bounding box type - [StructLayout(LayoutKind.Sequential)] - public struct BoundingBox - { - /// - /// Minimum vertex box-corner - /// - public Vector3 min; - - /// - /// Maximum vertex box-corner - /// - public Vector3 max; - - public BoundingBox(Vector3 min, Vector3 max) - { - this.min = min; - this.max = max; - } - } - /// /// Ray, ray for raycasting /// diff --git a/Raylib-cs/types/Rectangle.cs b/Raylib-cs/types/Rectangle.cs new file mode 100644 index 0000000..affd42f --- /dev/null +++ b/Raylib-cs/types/Rectangle.cs @@ -0,0 +1,29 @@ +using System.Runtime.InteropServices; + +namespace Raylib_cs +{ + /// + /// Rectangle type + /// + [StructLayout(LayoutKind.Sequential)] + public struct Rectangle + { + public float x; + public float y; + public float width; + public float height; + + public Rectangle(float x, float y, float width, float height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + + public override string ToString() + { + return $"{{X:{x} Y:{y} Width:{width} Height:{height}}}"; + } + } +}