]> git.cworth.org Git - apitrace/blobdiff - glretrace.py
Update drawable on variations of glViewport (issue #71)
[apitrace] / glretrace.py
index deeb86d4ebe39c368944da2f6147913da4701b6a..bb88288060f09d968a9303808d92894e17aeef61 100644 (file)
@@ -224,6 +224,21 @@ class GlRetracer(Retracer):
         # Infer the drawable size from GL calls
         if function.name == "glViewport":
             print '    glretrace::updateDrawable(x + width, y + height);'
+        if function.name == "glViewportArray":
+            # We are concerned about drawables so only care for the first viewport
+            print '    if (first == 0 && count > 0) {'
+            print '        GLfloat x = v[0], y = v[1], w = v[2], h = v[3];'
+            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '    }'
+        if function.name == "glViewportIndexedf":
+            print '    if (index == 0) {'
+            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '    }'
+        if function.name == "glViewportIndexedfv":
+            print '    if (index == 0) {'
+            print '        GLfloat x = v[0], y = v[1], w = v[2], h = v[3];'
+            print '        glretrace::updateDrawable(x + w, y + h);'
+            print '    }'
         if function.name in ('glBlitFramebuffer', 'glBlitFramebufferEXT'):
             # Some applications do all their rendering in a framebuffer, and
             # then just blit to the drawable without ever calling glViewport.