Enhex / Urho3D_imgui

External library for integrating imgui with Urho3D.
MIT License
15 stars 5 forks source link

Emscripten Support #3

Open SirNate0 opened 3 years ago

SirNate0 commented 3 years ago

I saw in the forum thread that it didn't work with Emscripten, but I found the issue that was stopping it. The Graphics::Draw call used (the one specifying the baseVertexIndex) is not supported without GL3 support. Simply removing the specification of 0 for the base vertex index, as below, results in it working when built for Emscripten rather than silently failing.

// In SystemUI.cpp
                graphics->Draw(TRIANGLE_LIST, idxBufferOffset, cmd->ElemCount, /*0,*/ 0, vertexBuffer_.GetVertexCount());
Enhex commented 3 years ago

Hi, I'm not actively maintaining this project so you're better off forking it to do changes.