From e1c3a5fcfeb1410624d27dd517b795ee751433b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 6 May 2011 23:27:44 +0100 Subject: [PATCH] Dump (the first face of) cube map textures. --- glstate.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.7.4