I need the ability to send a draw command using a bgfx::Texture that I own (not one created by vg).
This is, as far as I know, the only way to draw multiple 3D viewports inside of UI widgets. (as in this video, for reference : https://twitter.com/hugoamnov/status/978444939959898112)
It's pretty nice as this way you send the draw commands of the viewports exactly in the same way you send the rest of the UI graphics.
I implemented the change locally and it works fine. API changes are minor : it just needs a function to create an Image with a bgfx texture handle.
Note : I opted for a uint16_t instead of directly a bgfx::TextureHandle : it is less explicit in term of the function signature, but it was the only way to not depend on bgfx in vg's header. In my opinion depending on bgfx in the header would be kind of okay since vg works only with bgfx anyway, but all this is up to you ;)
Another option would be to make the name explicit like : createBgfxImage or registerBgfxImage.
I need the ability to send a draw command using a
bgfx::Texture
that I own (not one created by vg).This is, as far as I know, the only way to draw multiple 3D viewports inside of UI widgets. (as in this video, for reference : https://twitter.com/hugoamnov/status/978444939959898112) It's pretty nice as this way you send the draw commands of the viewports exactly in the same way you send the rest of the UI graphics.
I implemented the change locally and it works fine. API changes are minor : it just needs a function to create an Image with a bgfx texture handle.
Note : I opted for a uint16_t instead of directly a bgfx::TextureHandle : it is less explicit in term of the function signature, but it was the only way to not depend on bgfx in vg's header. In my opinion depending on bgfx in the header would be kind of okay since vg works only with bgfx anyway, but all this is up to you ;) Another option would be to make the name explicit like : createBgfxImage or registerBgfxImage.