JoshuaBrookover / bigg

bgfx, imgui, glfw, glm
The Unlicense
224 stars 35 forks source link

ImDrawCmd::TextureId not copied properly #18

Closed pezcode closed 5 years ago

pezcode commented 5 years ago

I'm setting a texture handle for font rendering, and the texture ID carried through cmd->TextureId never makes it. The bug is here:

https://github.com/JoshuaBrookover/bigg/blob/8bad04fedb6a0a52da483087cf1a051e5cc5007f/src/bigg_imgui.hpp#L112

If cmd->TextureId is 2, then flags wrongly ends up being 2 and handle 0. This looks like an issue with endianness. Not sure why that flags bit is there, it should be enough to simply cast cmd->TextureId to a uint16_t for bgfx.

I'd be happy to send a PR with a fix.

JoshuaBrookover commented 5 years ago

Ah yeah, it looks like maybe this code was copied from elsewhere. I would merge a PR with the fix.

Thanks