'''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 = [
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
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