]> git.cworth.org Git - vogl/blobdiff - src/vogleditor/vogleditor_qapicalltreemodel.cpp
UI: Calls within glBegin/glEnd blocks are now nested in the API call tree (including...
[vogl] / src / vogleditor / vogleditor_qapicalltreemodel.cpp
index 77493a0968dd3a76c7cc9224689b522cccec4222..a3f8ca3a03ab13d1e9e3c2c68a9ddcd744352554 100644 (file)
@@ -235,6 +235,16 @@ void vogleditor_QApiCallTreeModel::setupModelData(vogl_trace_file_reader* pTrace
             // reset the CurFrame so that a new frame node will be created on the next api call
             pCurFrame = NULL;
          }
+         else if (entrypoint_id == VOGL_ENTRYPOINT_glBegin)
+         {
+             // items in the glBegin/glEnd block will be nested, including the glEnd
+             pCurParent = item;
+         }
+         else if (entrypoint_id == VOGL_ENTRYPOINT_glEnd)
+         {
+             // move the parent back one level of the hierarchy, to its own parent
+             pCurParent = pCurParent->parent();
+         }
       }
 
       if (pTrace_reader->get_packet_type() == cTSPTEOF)
@@ -528,7 +538,9 @@ vogleditor_apiCallTreeItem *vogleditor_QApiCallTreeModel::find_prev_drawcall(vog
         {
             gl_entrypoint_id_t entrypointId = static_cast<gl_entrypoint_id_t>(pItem->apiCallItem()->getGLPacket()->m_entrypoint_id);
             if (vogl_is_draw_entrypoint(entrypointId) ||
-                vogl_is_clear_entrypoint(entrypointId))
+                vogl_is_clear_entrypoint(entrypointId) ||
+                (entrypointId == VOGL_ENTRYPOINT_glBitmap) ||
+                (entrypointId == VOGL_ENTRYPOINT_glEnd))
             {
                 pFound = iter.peekPrevious();
                 break;
@@ -561,7 +573,9 @@ vogleditor_apiCallTreeItem *vogleditor_QApiCallTreeModel::find_next_drawcall(vog
         {
             gl_entrypoint_id_t entrypointId = static_cast<gl_entrypoint_id_t>(pItem->apiCallItem()->getGLPacket()->m_entrypoint_id);
             if (vogl_is_draw_entrypoint(entrypointId) ||
-                vogl_is_clear_entrypoint(entrypointId))
+                vogl_is_clear_entrypoint(entrypointId) ||
+                (entrypointId == VOGL_ENTRYPOINT_glBitmap) ||
+                (entrypointId == VOGL_ENTRYPOINT_glEnd))
             {
                 pFound = iter.peekNext();
                 break;