[RFE] Option for NanoVG with bgfx rendering

Hi there - first off, huge thanks for creating LWJGL. Have been evaluating the latest version for a mixed 2D/3D UI animation project, lots of impressive stuff here.

I was wondering if there has been any consideration of using the BGFX backend for NanoVG, as an alternative to the native OpenGL implementation. Especially given Apple's announcement of deprecating OpenGL, BGFX seems like great solution for portability and (hopeful) compatibility with low-level graphics API changes.

Obviously, the resulting nanovg module would have a dependency on the BGFX module as well as the included shaders. I do understand wanting to keep the modules in LWJGL as light-weight as possible, so perhaps this could be an alternate option, separate from the more basic NanoVG package?

Is this something the team has considered? Or could offer any guidance on pursuing? I'm not super familiar with the build/generator system yet, so figured I'd ask here before spending lots of time on this.

Alternatively, is there any other API or tool that people are using for a simple 2D vector graphics API on top of the BGFX layer? Support for basic shapes, fill/stroke, text, etc. Apart from the hard OpenGL dependency, NanoVG really seems like a great choice, but maybe I'm missing some other option?

Fantastic - that was quick! Looking at the demo code and appears to be just what I need. Thanks so much, look forward to test driving this once the next snapshot build goes up - will let you know how it goes.

I was pleasantly surprised though, to find that calls to texture() and image() from Java seemed to still work! Either the field alignment was magically correct (which seems unlikely since the BGFX struct is smaller), or I'm thinking you must have already dealt with this somehow? But I'm curious what is going on here. Is https://github.com/LWJGL-CI/bgfx the right place to be looking for the BGFX lib that the snapshot is built against? Or are there modifications somewhere else that are handling this struct?

In any case, it does seem to be working properly, which is great. I'm just quite confused what is going on with this struct. Appreciate any guidance here!

I was pleasantly surprised though, to find that calls to texture() and image() from Java seemed to still work! Either the field alignment was magically correct (which seems unlikely since the BGFX struct is smaller), or I'm thinking you must have already dealt with this somehow?

It happens to work because struct members in C are naturally aligned by default. The BGFX struct is actually larger on x64 because of the alignment/padding requirements. It just so happens that the image member matches exactly between the two implementations and GL's texture member matches BGFX's handle.

But I'm curious what is going on here. Is https://github.com/LWJGL-CI/bgfx the right place to be looking for the BGFX lib that the snapshot is built against? Or are there modifications somewhere else that are handling this struct?

It happens to work because struct members in C are naturally aligned by default. The BGFX struct is actually larger on x64 because of the alignment/padding requirements. It just so happens that the image member matches exactly between the two implementations and GL's texture member matches BGFX's handle.

Oh wow - well that was very good luck! I'll watch the repo for that next snapshot - and big thanks again for the super quick fixes on this.