From: José Fonseca Date: Fri, 6 May 2011 22:27:44 +0000 (+0100) Subject: Dump (the first face of) cube map textures. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=e1c3a5fcfeb1410624d27dd517b795ee751433b9;p=apitrace Dump (the first face of) cube map textures. --- 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);