IDL C#: Added flag comments.

This commit is contained in:
Бранимир Караџић
2019-07-14 18:23:57 -07:00
parent 72d0a0c4fa
commit 6b32a32bb2
3 changed files with 600 additions and 6 deletions

View File

@@ -328,7 +328,7 @@ 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,7 +169,12 @@ local function FlagBlock(typ)
end
yield("\t/// <summary>")
yield("\t/// " .. flag.comment)
if (type(flag.comment) == "table") then
comment = table.concat(flag.comment, "\n\t\t/// ")
else
comment = flag.comment
end
yield("\t/// " .. comment)
yield("\t/// </summary>")
end
@@ -291,23 +296,35 @@ function converter.types(typ)
end
end
lookup[flagName] = value
table.insert(flags, {
name = flagName,
value = 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
end
if typ.shift then
table.insert(flags, {
name = name .. "Shift",
value = typ.shift,
format = "%d",
comment = typ.comment,
})
end
if typ.mask then
-- generate Mask
table.insert(flags, {
name = name .. "Mask",
value = typ.mask,
comment = typ.comment,
})
lookup[name .. "Mask"] = typ.mask
end