Added C# bindings.
This commit is contained in:
parent
7184da2050
commit
7d047dfc5b
1482
bindings/cs/bgfx.cs
Normal file
1482
bindings/cs/bgfx.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -94,7 +94,9 @@ end
|
||||
local converter = {}
|
||||
local yield = coroutine.yield
|
||||
|
||||
local function gen()
|
||||
local gen = {}
|
||||
|
||||
function gen.gen()
|
||||
local r = csharp_template:gsub("$(%l+)", function(what)
|
||||
local tmp = {}
|
||||
for _, object in ipairs(idl[what]) do
|
||||
@ -290,7 +292,13 @@ function converter.funcs(func)
|
||||
yield("internal static extern unsafe " .. convert_ret_type(func.ret) .. " " .. func.cname .. args .. ");")
|
||||
end
|
||||
|
||||
print(gen())
|
||||
|
||||
-- printtable("idl types", idl.types)
|
||||
-- printtable("idl funcs", idl.funcs)
|
||||
|
||||
function gen.write(codes, outputfile)
|
||||
local out = assert(io.open(outputfile, "wb"))
|
||||
out:write(codes)
|
||||
out:close()
|
||||
end
|
||||
|
||||
return gen
|
||||
|
@ -66,16 +66,10 @@ newaction {
|
||||
generate("temp.bgfx.idl.inl", "../src/bgfx.idl.inl", "\t")
|
||||
generate("temp.defines.h", "../include/bgfx/defines.h", "\t")
|
||||
|
||||
os.exit()
|
||||
do
|
||||
local csgen = require "csharp"
|
||||
csgen.write(csgen.gen(), "../bindings/cs/bgfx.cs")
|
||||
end
|
||||
}
|
||||
|
||||
newaction {
|
||||
trigger = "c#-idl",
|
||||
description = "Generate bgfx C# bindings.",
|
||||
execute = function ()
|
||||
|
||||
local csidl = require "csharp"
|
||||
|
||||
os.exit()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user