]> git.cworth.org Git - apitrace/blobdiff - glstate.py
cli: Add a new "apitrace diff" command.
[apitrace] / glstate.py
index c348d2b99b69dd2273ca30067f6a5c1fe237f7c6..7ab2dd14def421e0f6214fd9766eef55d2e08137 100644 (file)
 '''Generate code to dump most GL state into JSON.'''
 
 
-from stdapi import *
+from specs.stdapi import *
 
-from gltypes import *
-from glparams import *
+from specs.gltypes import *
+from specs.glparams import *
 
 
 texture_targets = [
@@ -189,9 +189,9 @@ class JsonWriter(Visitor):
     It expects a previously declared JSONWriter instance named "json".'''
 
     def visit_literal(self, literal, instance):
-        if literal.format == 'Bool':
+        if literal.kind == 'Bool':
             print '    json.writeBool(%s);' % instance
-        elif literal.format in ('SInt', 'Uint', 'Float', 'Double'):
+        elif literal.kind in ('SInt', 'Uint', 'Float', 'Double'):
             print '    json.writeNumber(%s);' % instance
         else:
             raise NotImplementedError
@@ -249,7 +249,7 @@ class StateDumper:
         print 'const char *'
         print 'enumToString(GLenum pname)'
         print '{'
-        print '    switch(pname) {'
+        print '    switch (pname) {'
         for name in GLenum.values:
             print '    case %s:' % name
             print '        return "%s";' % name