浏览代码

Make c# bindings bgfx a static class; make it public; put it in a namespace

Vladimir Vukicevic 6 年之前
父节点
当前提交
c688a66d89
共有 2 个文件被更改,包括 123 次插入115 次删除
  1. 115 113
      bindings/cs/bgfx.cs
  2. 8 2
      scripts/bindings-cs.lua

文件差异内容过多而无法显示
+ 115 - 113
bindings/cs/bgfx.cs


+ 8 - 2
scripts/bindings-cs.lua

@@ -6,16 +6,22 @@ using System;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices;
 using System.Security;
 using System.Security;
 
 
-internal struct bgfx
+namespace Bgfx
+{
+public static partial class bgfx
 {
 {
 	$types
 	$types
 
 
 	$funcs
 	$funcs
+
+#if !BGFX_CSHARP_CUSTOM_DLLNAME
 #if DEBUG
 #if DEBUG
 	const string DllName = "bgfx_debug.dll";
 	const string DllName = "bgfx_debug.dll";
 #else
 #else
 	const string DllName = "bgfx.dll";
 	const string DllName = "bgfx.dll";
 #endif
 #endif
+#endif
+}
 }
 }
 ]]
 ]]
 
 
@@ -330,7 +336,7 @@ function converter.funcs(func)
 	for _, arg in ipairs(func.args) do
 	for _, arg in ipairs(func.args) do
 		table.insert(args, convert_type(arg) .. " " .. arg.name)
 		table.insert(args, convert_type(arg) .. " " .. arg.name)
 	end
 	end
-	yield("internal static extern unsafe " .. convert_ret_type(func.ret) .. " " .. func.cname
+	yield("public static extern unsafe " .. convert_ret_type(func.ret) .. " " .. func.cname
 		.. "(" .. table.concat(args, ", ") .. ");")
 		.. "(" .. table.concat(args, ", ") .. ");")
 end
 end
 
 

部分文件因为文件数量过多而无法显示