Closed bkaradzic closed 4 years ago
The latest commit (2d0d7735eac193356a57f229c087be4820d6b41d) now uses IDL generated bindings, will do a PR for the generator once I clean up the code a bit.
:+1: Great!
All files you currently have inside bindbc-bgfx/source/bindbc/bgfx
could go to bgfx/bindings/d
. And then keep this repository just as is with copy of those files.
The current implementation only generates types.d
and funcs.d
under the bindings folder, which then can replace the corresponding files in these bindings to target any future (or past) releases. Would this be enough?
Yes, in bgfx just API is generated, all helper utilities are fine to stay inside your repo.
@GoaLitiuM Did u considered putting the scripts/steps that generate the bidings here on the repo? So that future contributors can generate correctly the API and keep pace with bgfx releases, if wanted/needed.
I'll always have latest in bgfx. But any external repo should be locked to specific rev from bgfx (not the latest from the master).
I simply used genie idl
to generate the bindings from scratch (this assumes you know how to build bgfx with the genie tool), then you can simply replace funcs.d
and types.d
with the ones generated under bgfx/bindings/d
directory. I'll try to keep this repo up-to-date as well as the bgfx API changes.
Since D is C-like language, generating D bindings via IDL would be fairly trivial. See example of generating C# bindings: https://github.com/bkaradzic/bgfx/blob/master/scripts/bindings-cs.lua
By providing IDL script generator for D language, maintenance of your D language package would be drastically simplified.