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

Reorganize/format

This commit is contained in:
Rgebee 2022-02-10 08:18:46 +00:00
commit 014b1a3596
4 changed files with 75 additions and 66 deletions

View file

@ -480,15 +480,15 @@ namespace Raylib_cs
// Load text data from file (read), returns a '\0' terminated string // Load text data from file (read), returns a '\0' terminated string
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [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() // Unload file text data allocated by LoadFileText()
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [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 // Save text data to file (write), string must be '\0' terminated, returns true on success
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [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 // Check if file exists
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
@ -528,7 +528,7 @@ namespace Raylib_cs
/// <summary>Get filenames in a directory path (memory should be freed)</summary> /// <summary>Get filenames in a directory path (memory should be freed)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern char **GetDirectoryFiles(sbyte* dirPath, int *count); public static extern char** GetDirectoryFiles(sbyte* dirPath, int* count);
/// <summary>Clear directory files paths buffers (free memory)</summary> /// <summary>Clear directory files paths buffers (free memory)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

View file

@ -0,0 +1,26 @@
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
/// <summary>Bounding box type</summary>
[StructLayout(LayoutKind.Sequential)]
public struct BoundingBox
{
/// <summary>
/// Minimum vertex box-corner
/// </summary>
public Vector3 min;
/// <summary>
/// Maximum vertex box-corner
/// </summary>
public Vector3 max;
public BoundingBox(Vector3 min, Vector3 max)
{
this.min = min;
this.max = max;
}
}
}

View file

@ -3,52 +3,6 @@ using System.Runtime.InteropServices;
namespace Raylib_cs namespace Raylib_cs
{ {
/// <summary>
/// Rectangle type
/// </summary>
[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}}}";
}
}
/// <summary>Bounding box type</summary>
[StructLayout(LayoutKind.Sequential)]
public struct BoundingBox
{
/// <summary>
/// Minimum vertex box-corner
/// </summary>
public Vector3 min;
/// <summary>
/// Maximum vertex box-corner
/// </summary>
public Vector3 max;
public BoundingBox(Vector3 min, Vector3 max)
{
this.min = min;
this.max = max;
}
}
/// <summary> /// <summary>
/// Ray, ray for raycasting /// Ray, ray for raycasting
/// </summary> /// </summary>

View file

@ -0,0 +1,29 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
/// <summary>
/// Rectangle type
/// </summary>
[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}}}";
}
}
}