X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fdbg_gui.cc;h=6a6511fa88d5962779fdc1b6d77d60e2fda28e09;hp=a968b29fa45f34a67c6e4354978294800107c1fc;hb=da8e3a1dd04a5ac29bcaa9582430c58a769ac571;hpb=512acaa2427ffa2ff19079f999bc2fcd7cd33925 diff --git a/src/dbg_gui.cc b/src/dbg_gui.cc index a968b29..6a6511f 100644 --- a/src/dbg_gui.cc +++ b/src/dbg_gui.cc @@ -7,6 +7,9 @@ static void render_func(ImDrawData *ddat); +bool debug_gui, parent_expanded; +SceneNode *dbg_sel_node; + static ImGuiIO *io; static Texture *tex; @@ -146,7 +149,12 @@ static void render_func(ImDrawData *ddat) glTexCoordPointer(2, GL_FLOAT, sizeof *vbuf, &vbuf[0].uv); glColorPointer(4, GL_UNSIGNED_BYTE, sizeof *vbuf, &vbuf[0].col); - glDrawElements(GL_TRIANGLES, cmd->ElemCount, GL_UNSIGNED_SHORT, ibuf); + if(glcaps.draw_range) { + int max_vidx = cmdlist->VtxBuffer.Size - 1; + glDrawRangeElements(GL_TRIANGLES, 0, max_vidx, cmd->ElemCount, GL_UNSIGNED_SHORT, ibuf); + } else { + glDrawElements(GL_TRIANGLES, cmd->ElemCount, GL_UNSIGNED_SHORT, ibuf); + } glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY);