]> git.cworth.org Git - apitrace/commitdiff
Warn when calling GL entry points without a current context.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 2 Feb 2012 13:59:31 +0000 (13:59 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 2 Feb 2012 13:59:31 +0000 (13:59 +0000)
glretrace.py

index e862e25a3757b9c99ad94d7f556abcfd3dbee8e9..8dfc340d36860273fd199fcba322b05bf2709ec6 100644 (file)
@@ -230,6 +230,11 @@ class GlRetracer(Retracer):
         if function.name == "glEnd":
             print '    glretrace::insideGlBeginEnd = false;'
 
+        if function.name.startswith('gl') and not function.name.startswith('glX'):
+            print r'    if (!glretrace::context && !glretrace::benchmark && !retrace::profiling) {'
+            print r'        retrace::warning(call) << "no current context\n";'
+            print r'    }'
+
         if function.name == 'memcpy':
             print '    if (!dest || !src || !n) return;'