From 5ee9ca3baa13182bf5a8dea21c1061e6a72d4dcf Mon Sep 17 00:00:00 2001
From: JupiterRider <60042618+JupiterRider@users.noreply.github.com>
Date: Fri, 6 Dec 2024 20:54:39 +0100
Subject: [PATCH] ExportMeshAsCode added
---
Raylib-cs/interop/Raylib.cs | 11 +++++++----
Raylib-cs/types/Raylib.Utils.cs | 7 +++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/Raylib-cs/interop/Raylib.cs b/Raylib-cs/interop/Raylib.cs
index e6cc023..066a893 100644
--- a/Raylib-cs/interop/Raylib.cs
+++ b/Raylib-cs/interop/Raylib.cs
@@ -2504,10 +2504,6 @@ public static unsafe partial class Raylib
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawMeshInstanced(Mesh mesh, Material material, Matrix4x4* transforms, int instances);
- /// Export mesh data to file, returns true on success
- [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
- public static extern CBool ExportMesh(Mesh mesh, sbyte* fileName);
-
/// Compute mesh bounding box limits
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern BoundingBox GetMeshBoundingBox(Mesh mesh);
@@ -2516,6 +2512,13 @@ public static unsafe partial class Raylib
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void GenMeshTangents(Mesh* mesh);
+ /// Export mesh data to file, returns true on success
+ [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
+ public static extern CBool ExportMesh(Mesh mesh, sbyte* fileName);
+
+ /// Export mesh as code file (.h) defining multiple arrays of vertex attributes
+ [DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
+ public static extern CBool ExportMeshAsCode(Mesh mesh, sbyte* fileName);
// Mesh generation functions
diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs
index 7b87c9c..b85a6b5 100644
--- a/Raylib-cs/types/Raylib.Utils.cs
+++ b/Raylib-cs/types/Raylib.Utils.cs
@@ -1240,6 +1240,13 @@ public static unsafe partial class Raylib
return ExportMesh(mesh, str1.AsPointer());
}
+ /// Export mesh as code file (.h) defining multiple arrays of vertex attributes
+ public static CBool ExportMeshAsCode(Mesh mesh, string fileName)
+ {
+ using var str1 = fileName.ToAnsiBuffer();
+ return ExportMeshAsCode(mesh, str1.AsPointer());
+ }
+
/// Draw a triangle strip defined by points
public static void DrawTriangleStrip3D(Vector3[] points, int pointCount, Color color)
{