diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-05-06 23:27:44 +0100 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-05-06 23:27:44 +0100 |
commit | e1c3a5fcfeb1410624d27dd517b795ee751433b9 (patch) | |
tree | 523c3327554fd53f520b1ecc916690abedb7d903 /glstate.py | |
parent | fe89e12083259eb2f734a114e140db3e6a30b8bf (diff) |
Dump (the first face of) cube map textures.
Diffstat (limited to 'glstate.py')
-rw-r--r-- | glstate.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); |