Skip to content
An IDL for bgfx
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes add gitattributes Mar 2, 2019
.gitignore
README.md Generate files in current dir Feb 28, 2019
bgfx-codegen.lua
bgfx-idl.lua new gen api Mar 14, 2019
bgfx.idl Updated IDL. Mar 13, 2019
codegen.lua Revert "Fixing indent for C99 (uses spaces instead of tabs)." Mar 13, 2019
doxygen.lua Fix comments issue, See #20 Mar 8, 2019
idl.lua bugfix for cpp header Mar 12, 2019
temp.bgfx.h C99: Added function id enum. Mar 14, 2019
temp.bgfx.hpp
temp.bgfx.idl.inl move user define functions to template file Mar 2, 2019
temp.bgfx.shim.cpp IDL shim. Mar 15, 2019
test.lua

README.md

An IDL for bgfx code generation

See https://github.com/cloudwu/bgfxidl/issues/9

Use lua bgfx-idl.lua . to generate bgfx IDL in current dir.

typedef "void"
typedef "uint16_t"
typedef "Memory"
typedef.VertexDecl "bgfx_vertex_decl_t"
typedef.VertexBufferHandle { "handle" }

func.createVertexBuffer -- { cname = "bgfx_create_vertex_buffer" } 
	"VertexBufferHandle"  -- return type
	._mem "const Memory *"  -- args
	._decl "const VertexDecl &"
	._flags "uint16_t"

func.destory { cname = "bgfx_destroy_vertex_buffer" }
	"void"
	._handle "VertexBufferHandle"

Generate C99 APIs :

BGFX_C_API bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const bgfx_memory_t * _mem, const bgfx_vertex_decl_t * _decl, uint16_t _flags)
{
        const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
        union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle_ret;
        handle_ret.cpp = bgfx::createVertexBuffer((const bgfx::Memory *)_mem, decl, _flags);
        return handle_ret.c;
}

BGFX_C_API void bgfx_destroy_vertex_buffer(bgfx_vertex_buffer_handle_t _handle)
{
        union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle = { _handle };
        bgfx::destory(handle.cpp);
}

License

The same with bgfx :

https://github.com/bkaradzic/bgfx/blob/master/LICENSE

You can’t perform that action at this time.