summaryrefslogtreecommitdiff
path: root/glstate.py
diff options
context:
space:
mode:
Diffstat (limited to 'glstate.py')
-rw-r--r--glstate.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/glstate.py b/glstate.py
index fb3e090..c348d2b 100644
--- a/glstate.py
+++ b/glstate.py
@@ -380,13 +380,18 @@ class StateDumper:
print ' json.beginMember(name);'
print ' glActiveTexture(GL_TEXTURE0 + unit);'
print ' json.beginObject();'
- print ' GLint texture;'
+ print ' GLboolean enabled;'
+ print ' GLint binding;'
print
for target, binding in texture_targets:
print ' // %s' % target
- print ' texture = 0;'
- print ' glGetIntegerv(%s, &texture);' % binding
- print ' if (glIsEnabled(%s) || texture) {' % target
+ print ' enabled = GL_FALSE;'
+ print ' glGetBooleanv(%s, &enabled);' % target
+ print ' json.writeBoolMember("%s", enabled);' % target
+ print ' binding = 0;'
+ print ' glGetIntegerv(%s, &binding);' % binding
+ print ' json.writeNumberMember("%s", binding);' % binding
+ print ' if (enabled || binding) {'
print ' json.beginMember("%s");' % target
print ' json.beginObject();'
self.dump_atoms(glGetTexParameter, target)