Updated IDL.

This commit is contained in:
Бранимир Караџић 2019-07-14 21:19:46 -07:00
parent 578d595a3b
commit d5fcbf98cf
6 changed files with 56 additions and 63 deletions

View File

@ -538,7 +538,8 @@ public static partial class bgfx
Wireframe = 0x00000001,
/// <summary>
/// Enable infinitely fast hardware test. No draw calls will be submitted to driver. Its useful when profiling to quickly assess bottleneck between CPU and GPU.
/// 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.
/// </summary>
Ifh = 0x00000002,
@ -917,7 +918,8 @@ public static partial class bgfx
FlushAfterRender = 0x00002000,
/// <summary>
/// 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`.
/// 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`.
/// </summary>
FlipAfterRender = 0x00004000,

View File

@ -245,7 +245,9 @@
#define BGFX_DEBUG_NONE UINT32_C(0x00000000) //!< No debug.
#define BGFX_DEBUG_WIREFRAME UINT32_C(0x00000001) //!< Enable wireframe for all primitives.
#define BGFX_DEBUG_IFH UINT32_C(0x00000002) //!< Enable infinitely fast hardware test. No draw calls will be submitted to driver. Its useful when profiling to quickly assess bottleneck between CPU and GPU.
/// 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.
#define BGFX_DEBUG_IFH UINT32_C(0x00000002)
#define BGFX_DEBUG_STATS UINT32_C(0x00000004) //!< Enable statistics display.
#define BGFX_DEBUG_TEXT UINT32_C(0x00000008) //!< Enable debug text display.
#define BGFX_DEBUG_PROFILER UINT32_C(0x00000010) //!< Enable profiler.
@ -417,7 +419,9 @@
#define BGFX_RESET_MAXANISOTROPY UINT32_C(0x00000100) //!< Turn on/off max anisotropy.
#define BGFX_RESET_CAPTURE UINT32_C(0x00000200) //!< Begin screen capture.
#define BGFX_RESET_FLUSH_AFTER_RENDER UINT32_C(0x00002000) //!< Flush rendering after submitting to GPU.
#define BGFX_RESET_FLIP_AFTER_RENDER UINT32_C(0x00004000) //!< 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`.
/// 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`.
#define BGFX_RESET_FLIP_AFTER_RENDER UINT32_C(0x00004000)
#define BGFX_RESET_SRGB_BACKBUFFER UINT32_C(0x00008000) //!< Enable sRGB backbuffer.
#define BGFX_RESET_HDR10 UINT32_C(0x00010000) //!< Enable HDR10 rendering.
#define BGFX_RESET_HIDPI UINT32_C(0x00020000) //!< Enable HiDPI rendering.

View File

@ -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. Its 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.

View File

@ -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

View File

@ -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

View File

@ -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