From a729fe776e8a19f8a9a801fc7908dddd2b000c70 Mon Sep 17 00:00:00 2001 From: Robert Menzel Date: Fri, 19 Oct 2012 16:55:46 +0200 Subject: [PATCH] sopport more formats when downloading images from GL --- src/ACGL/OpenGL/Objects/Texture.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACGL/OpenGL/Objects/Texture.cc b/src/ACGL/OpenGL/Objects/Texture.cc index 26db031..e2600b5 100644 --- a/src/ACGL/OpenGL/Objects/Texture.cc +++ b/src/ACGL/OpenGL/Objects/Texture.cc @@ -103,7 +103,7 @@ SharedTextureData Texture::getImageData(GLint _lod, GLenum _type) const if (mFormat == GL_RGB) channels = 3; // TODO: check the other channel types GLubyte* imageData = new GLubyte[width * height * getGLTypeSize(_type) * channels]; - glGetTexImage(mTarget, _lod, GL_RGB, _type, (GLvoid*)imageData); + glGetTexImage(mTarget, _lod, mFormat, _type, (GLvoid*)imageData); // revert to the previously bound texture glBindTexture(mTarget, prevTexture); -- GitLab