summaryrefslogtreecommitdiff
path: root/glstate.py
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2011-05-06 23:27:44 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-05-06 23:27:44 +0100
commite1c3a5fcfeb1410624d27dd517b795ee751433b9 (patch)
tree523c3327554fd53f520b1ecc916690abedb7d903 /glstate.py
parentfe89e12083259eb2f734a114e140db3e6a30b8bf (diff)
Dump (the first face of) cube map textures.
Diffstat (limited to 'glstate.py')
-rw-r--r--glstate.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/glstate.py b/glstate.py
index 40431ca..5f7416b 100644
--- a/glstate.py
+++ b/glstate.py
@@ -38,7 +38,7 @@ texture_targets = [
('GL_TEXTURE_2D', 'GL_TEXTURE_BINDING_2D'),
('GL_TEXTURE_3D', 'GL_TEXTURE_BINDING_3D'),
('GL_TEXTURE_RECTANGLE', 'GL_TEXTURE_BINDING_RECTANGLE'),
- #(GL_TEXTURE_CUBE_MAP, 'GL_TEXTURE_BINDING_CUBE_MAP')
+ ('GL_TEXTURE_CUBE_MAP', 'GL_TEXTURE_BINDING_CUBE_MAP')
]
@@ -401,6 +401,11 @@ writeTextureImage(JSONWriter &json, GLenum target, GLint level)
json.writeNumberMember("__channels__", 4);
GLubyte *pixels = new GLubyte[depth*width*height*4];
+
+ if (target == GL_TEXTURE_CUBE_MAP) {
+ // TODO: dump other faces too
+ target = GL_TEXTURE_CUBE_MAP_POSITIVE_X;
+ }
glGetTexImage(target, level, GL_RGBA, GL_UNSIGNED_BYTE, pixels);