diff --git a/bindings/d/package.d b/bindings/d/package.d index e9e610edf..c55ef113f 100644 --- a/bindings/d/package.d +++ b/bindings/d/package.d @@ -1357,13 +1357,6 @@ extern(C++, "bgfx") struct VertexLayout{ */ [q{void}, q{decode}, q{bgfx.fakeenum.Attrib.Enum attrib, ref ubyte num, ref bgfx.fakeenum.AttribType.Enum type, ref bool normalized, ref bool asInt}, `C++`, q{const}], - /** - Returns `true` if VertexLayout contains attribute. - Params: - attrib = Attribute semantics. See: `bgfx::Attrib` - */ - [q{bool}, q{has}, q{bgfx.fakeenum.Attrib.Enum attrib}, `C++`, q{const}], - /** Skip `_num` bytes in vertex stream. Params: @@ -1375,25 +1368,6 @@ extern(C++, "bgfx") struct VertexLayout{ End VertexLayout. */ [q{void}, q{end}, q{}, `C++`], - - /** - Returns relative attribute offset from the vertex. - Params: - attrib = Attribute semantics. See: `bgfx::Attrib` - */ - [q{ushort}, q{getOffset}, q{bgfx.fakeenum.Attrib.Enum attrib}, `C++`, q{const}], - - /** - Returns vertex stride. - */ - [q{ushort}, q{getStride}, q{}, `C++`, q{const}], - - /** - Returns size of vertex buffer for number of vertices. - Params: - num = Number of vertices. - */ - [q{uint}, q{getSize}, q{uint num}, `C++`, q{const}], ], true); return ret; }(), typeof(this).stringof)); @@ -1487,7 +1461,7 @@ extern(C++, "bgfx") struct Encoder{ mtx = Pointer to first matrix in array. num = Number of matrices in array. */ - [q{uint}, q{setTransform}, q{const(void)* mtx, ushort num}, `C++`], + [q{uint}, q{setTransform}, q{const(void)* mtx, ushort num=1}, `C++`], /** Set model matrix from matrix cache for draw primitive. diff --git a/scripts/bgfx-codegen.lua b/scripts/bgfx-codegen.lua index 4069b933f..508481dd8 100644 --- a/scripts/bgfx-codegen.lua +++ b/scripts/bgfx-codegen.lua @@ -32,7 +32,7 @@ local type_actions = { local function cfunc(f) return function(func) - if not func.cpponly then + if (not func.cpponly) and (not func.cppinline or func.conly) then return f(func) end end diff --git a/scripts/bgfx.idl b/scripts/bgfx.idl index d1501cf12..e437270c3 100644 --- a/scripts/bgfx.idl +++ b/scripts/bgfx.idl @@ -1039,7 +1039,7 @@ func.VertexLayout.decode { const } .asInt "bool &" { out } --- Attribute is packed as int. --- Returns `true` if VertexLayout contains attribute. -func.VertexLayout.has { const } +func.VertexLayout.has { const, conly, cppinline } "bool" --- True if VertexLayout contains attribute. .attrib "Attrib::Enum" --- Attribute semantics. See: `bgfx::Attrib` @@ -1054,16 +1054,16 @@ func.VertexLayout["end"] "void" --- Returns relative attribute offset from the vertex. -func.VertexLayout.getOffset { const , cpponly } +func.VertexLayout.getOffset { const, cppinline } "uint16_t" --- Relative attribute offset from the vertex. .attrib "Attrib::Enum" --- Attribute semantics. See: `bgfx::Attrib` --- Returns vertex stride. -func.VertexLayout.getStride { const , cpponly } +func.VertexLayout.getStride { const, cppinline } "uint16_t" --- Vertex stride. --- Returns size of vertex buffer for number of vertices. -func.VertexLayout.getSize { const, cpponly } +func.VertexLayout.getSize { const, cppinline } "uint32_t" --- Size of vertex buffer for number of vertices. .num "uint32_t" --- Number of vertices. @@ -2216,6 +2216,7 @@ func.Encoder.setTransform --- to be used for other draw primitive call. .mtx "const void*" --- Pointer to first matrix in array. .num "uint16_t" --- Number of matrices in array. + { default = 1 } --- Set model matrix from matrix cache for draw primitive. func.Encoder.setTransform { cname = "set_transform_cached" } diff --git a/scripts/bindings-bf.lua b/scripts/bindings-bf.lua index dda9adb42..3423bd18d 100644 --- a/scripts/bindings-bf.lua +++ b/scripts/bindings-bf.lua @@ -357,6 +357,8 @@ function converter.funcs(func) if func.cpponly then return + elseif func.cppinline and not func.conly then + return end if func.comments ~= nil then diff --git a/scripts/bindings-cs.lua b/scripts/bindings-cs.lua index 476666312..0e9f21ed4 100644 --- a/scripts/bindings-cs.lua +++ b/scripts/bindings-cs.lua @@ -387,6 +387,8 @@ function converter.funcs(func) if func.cpponly then return + elseif func.cppinline and not func.conly then + return end if func.comments ~= nil then diff --git a/scripts/bindings-d.lua b/scripts/bindings-d.lua index b04a9d47a..dd8996403 100644 --- a/scripts/bindings-d.lua +++ b/scripts/bindings-d.lua @@ -334,7 +334,7 @@ local function genVersion() end local function genStructMemberFn(func) --NOTE: this does not work on nested structs - if func.class ~= nil and func.conly == nil then + if func.class ~= nil and func.conly == nil and func.cppinline == nil then local st = allStructs[func.class] local attribs = "" if func.comments ~= nil then @@ -804,7 +804,7 @@ extern(C++, "bgfx") package final abstract class %s{ end function converter.funcs(func) - if func.class == nil and func.conly == nil then + if func.class == nil and func.conly == nil and func.cppinline == nil then local extern = "C++, \"bgfx\"" local attribs = "" if func.cfunc ~= nil and func.name ~= "init" then --what the is "cfunc" even meant to mean? diff --git a/scripts/bindings-zig.lua b/scripts/bindings-zig.lua index 9e7f02f71..18b2cce40 100644 --- a/scripts/bindings-zig.lua +++ b/scripts/bindings-zig.lua @@ -405,6 +405,8 @@ function converter.funcs(params) local func = params.obj if func.cpponly then return + elseif func.cppinline and not func.conly then + return end -- skip for now, don't know how to handle variadic functions diff --git a/scripts/idl.lua b/scripts/idl.lua index b5bd2ae8a..68f14993b 100644 --- a/scripts/idl.lua +++ b/scripts/idl.lua @@ -235,6 +235,7 @@ idl.cfunc = "cfunc" idl.underscore = "underscore" idl.conly = "conly" idl.cpponly = "cpponly" +idl.cppinline = "cppinline" idl.shortname = "shortname" idl.NULL = "NULL" idl.UINT16_MAX = "UINT16_MAX"