mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 13:03:05 +01:00
Updated IDL.
This commit is contained in:
@@ -202,7 +202,8 @@ flag.Clear { bits = 16 }
|
||||
flag.Debug { bits = 32 }
|
||||
.None --- No debug.
|
||||
.Wireframe --- Enable wireframe for all primitives.
|
||||
.Ifh --- Enable infinitely fast hardware test. No draw calls will be submitted to driver. It’s useful when profiling to quickly assess bottleneck between CPU and GPU.
|
||||
.Ifh --- Enable infinitely fast hardware test. No draw calls will be submitted to driver.
|
||||
--- It's useful when profiling to quickly assess bottleneck between CPU and GPU.
|
||||
.Stats --- Enable statistics display.
|
||||
.Text --- Enable debug text display.
|
||||
.Profiler --- Enable profiler.
|
||||
@@ -328,7 +329,8 @@ flag.Reset { bits = 32 }
|
||||
.Maxanisotropy (9) --- Turn on/off max anisotropy.
|
||||
.Capture (10) --- Begin screen capture.
|
||||
.FlushAfterRender (14) --- Flush rendering after submitting to GPU.
|
||||
.FlipAfterRender (15) --- This flag specifies where flip occurs. Default behavior is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
|
||||
.FlipAfterRender (15) --- This flag specifies where flip occurs. Default behavior is that flip occurs
|
||||
--- before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
|
||||
.SrgbBackbuffer (16) --- Enable sRGB backbuffer.
|
||||
.Hdr10 (17) --- Enable HDR10 rendering.
|
||||
.Hidpi (18) --- Enable HiDPI rendering.
|
||||
|
||||
@@ -169,12 +169,9 @@ local function FlagBlock(typ)
|
||||
end
|
||||
|
||||
yield("\t/// <summary>")
|
||||
if (type(flag.comment) == "table") then
|
||||
comment = table.concat(flag.comment, "\n\t\t/// ")
|
||||
else
|
||||
comment = flag.comment
|
||||
for _, comment in ipairs(flag.comment) do
|
||||
yield("\t/// " .. comment)
|
||||
end
|
||||
yield("\t/// " .. comment)
|
||||
yield("\t/// </summary>")
|
||||
end
|
||||
|
||||
@@ -259,7 +256,9 @@ function converter.types(typ)
|
||||
end
|
||||
|
||||
yield("\t/// <summary>")
|
||||
yield("\t/// " .. enum.comment)
|
||||
for _, comment in ipairs(enum.comment) do
|
||||
yield("\t/// " .. comment)
|
||||
end
|
||||
yield("\t/// </summary>")
|
||||
end
|
||||
|
||||
@@ -296,18 +295,11 @@ function converter.types(typ)
|
||||
end
|
||||
end
|
||||
lookup[flagName] = value
|
||||
if flag.comment ~= nil then
|
||||
table.insert(flags, {
|
||||
name = flagName,
|
||||
value = value,
|
||||
comment = flag.comment,
|
||||
})
|
||||
else
|
||||
table.insert(flags, {
|
||||
name = flagName,
|
||||
value = value,
|
||||
})
|
||||
end
|
||||
table.insert(flags, {
|
||||
name = flagName,
|
||||
value = value,
|
||||
comment = flag.comment,
|
||||
})
|
||||
end
|
||||
|
||||
if typ.shift then
|
||||
@@ -381,12 +373,7 @@ function converter.funcs(func)
|
||||
|
||||
for _, arg in ipairs(func.args) do
|
||||
if arg.comment ~= nil then
|
||||
local comment = ""
|
||||
if (type(arg.comment) == "table") then
|
||||
comment = table.concat(arg.comment, " ")
|
||||
else
|
||||
comment = arg.comment
|
||||
end
|
||||
local comment = table.concat(arg.comment, " ")
|
||||
|
||||
yield("/// <param name=\""
|
||||
.. arg.name
|
||||
@@ -430,4 +417,9 @@ function gen.write(codes, outputfile)
|
||||
out:close()
|
||||
end
|
||||
|
||||
if (...) == nil then
|
||||
-- run `lua bindings-cs.lua` in command line
|
||||
print(gen.gen())
|
||||
end
|
||||
|
||||
return gen
|
||||
|
||||
@@ -576,13 +576,9 @@ local function doxygen_funcret(r, func, prefix)
|
||||
return
|
||||
end
|
||||
r[#r+1] = prefix
|
||||
if type(func.ret.comment) == "string" then
|
||||
r[#r+1] = string.format("%s @returns %s", prefix, func.ret.comment)
|
||||
else
|
||||
r[#r+1] = string.format("%s @returns %s", prefix, func.ret.comment[1])
|
||||
for i = 2,#func.ret.comment do
|
||||
r[#r+1] = string.format("%s %s", prefix, func.ret.comment[i])
|
||||
end
|
||||
r[#r+1] = string.format("%s @returns %s", prefix, func.ret.comment[1])
|
||||
for i = 2,#func.ret.comment do
|
||||
r[#r+1] = string.format("%s %s", prefix, func.ret.comment[i])
|
||||
end
|
||||
return r
|
||||
end
|
||||
@@ -603,13 +599,9 @@ local function doxygen_func(r, func, prefix)
|
||||
end
|
||||
local comment = string.format("%s @param[%s] %s", prefix, inout, arg.name)
|
||||
if arg.comment then
|
||||
if type(arg.comment) == "string" then
|
||||
r[#r+1] = comment .. " " .. arg.comment
|
||||
else
|
||||
r[#r+1] = comment .. " " .. arg.comment[1]
|
||||
for i = 2,#arg.comment do
|
||||
r[#r+1] = string.format("%s %s", prefix, arg.comment[i])
|
||||
end
|
||||
r[#r+1] = comment .. " " .. arg.comment[1]
|
||||
for i = 2,#arg.comment do
|
||||
r[#r+1] = string.format("%s %s", prefix, arg.comment[i])
|
||||
end
|
||||
else
|
||||
r[#r+1] = comment
|
||||
@@ -681,8 +673,9 @@ function codegen.gen_enum_define(enum)
|
||||
if not item.comment then
|
||||
text = item.name .. ","
|
||||
else
|
||||
local comment = table.concat(item.comment, " ")
|
||||
text = string.format("%s,%s //!< %s",
|
||||
item.name, namealign(item.name), item.comment)
|
||||
item.name, namealign(item.name), comment)
|
||||
end
|
||||
items[#items+1] = text
|
||||
end
|
||||
@@ -713,7 +706,10 @@ function codegen.gen_enum_cdefine(enum)
|
||||
local uname = cname:upper()
|
||||
local items = {}
|
||||
for index , item in ipairs(enum.enum) do
|
||||
local comment = item.comment or ""
|
||||
local comment = ""
|
||||
if item.comment then
|
||||
comment = table.concat(item.comment, " ")
|
||||
end
|
||||
local ename = item.cname
|
||||
if not ename then
|
||||
if enum.underscore then
|
||||
@@ -765,12 +761,8 @@ function codegen.gen_flag_cdefine(flag)
|
||||
-- combine flags
|
||||
if #item > 0 then
|
||||
if item.comment then
|
||||
if type(item.comment) == "table" then
|
||||
for _, c in ipairs(item.comment) do
|
||||
s[#s+1] = "/// " .. c
|
||||
end
|
||||
else
|
||||
s[#s+1] = "/// " .. item.comment
|
||||
for _, c in ipairs(item.comment) do
|
||||
s[#s+1] = "/// " .. c
|
||||
end
|
||||
end
|
||||
local sets = { "" }
|
||||
@@ -781,7 +773,13 @@ function codegen.gen_flag_cdefine(flag)
|
||||
else
|
||||
local comment = ""
|
||||
if item.comment then
|
||||
comment = " //!< " .. item.comment
|
||||
if #item.comment > 1 then
|
||||
for _, c in ipairs(item.comment) do
|
||||
s[#s+1] = "/// " .. c
|
||||
end
|
||||
else
|
||||
comment = " //!< " .. item.comment[1]
|
||||
end
|
||||
end
|
||||
value = string.format(flag.format, value)
|
||||
local code = string.format("#define %s %sUINT%d_C(0x%s)%s",
|
||||
@@ -852,7 +850,7 @@ local function text_with_comments(items, item, cstyle, is_classmember)
|
||||
end
|
||||
local text = string.format("%s%s %s;", typename, namealign(typename), name)
|
||||
if item.comment then
|
||||
if type(item.comment) == "table" then
|
||||
if #item.comment > 1 then
|
||||
table.insert(items, "")
|
||||
if cstyle then
|
||||
table.insert(items, "/**")
|
||||
@@ -868,7 +866,7 @@ local function text_with_comments(items, item, cstyle, is_classmember)
|
||||
else
|
||||
text = string.format(
|
||||
cstyle and "%s %s/** %s%s */" or "%s %s//!< %s",
|
||||
text, namealign(text, 40), item.comment, namealign(item.comment, 40))
|
||||
text, namealign(text, 40), item.comment[1], namealign(item.comment[1], 40))
|
||||
end
|
||||
end
|
||||
items[#items+1] = text
|
||||
|
||||
@@ -68,15 +68,10 @@ idl.types = all_types
|
||||
local function add_comment(item, comment)
|
||||
-- strip space
|
||||
comment = comment:match "(.-)%s*$"
|
||||
local last = item.comment
|
||||
if last then
|
||||
if type(last) == "string" then
|
||||
item.comment = { last, comment }
|
||||
else
|
||||
table.insert(item.comment, comment)
|
||||
end
|
||||
if item.comment then
|
||||
table.insert(item.comment, comment)
|
||||
else
|
||||
item.comment = comment
|
||||
item.comment = { comment }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user