diff options
author | Alejandro Marzini | 2010-07-31 22:54:10 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-07-31 22:54:10 +0000 |
commit | 7dbe257da8fcfd0996b21bdfe0d3851e3e2e1927 (patch) | |
tree | 00559cacc66487150ad9e124efa0ddbc689fec8d /backends/graphics/opengl/gltexture.cpp | |
parent | c93adcbd298b65fff72d3991d2690379c2ba8a88 (diff) | |
download | scummvm-rg350-7dbe257da8fcfd0996b21bdfe0d3851e3e2e1927.tar.gz scummvm-rg350-7dbe257da8fcfd0996b21bdfe0d3851e3e2e1927.tar.bz2 scummvm-rg350-7dbe257da8fcfd0996b21bdfe0d3851e3e2e1927.zip |
OPENGL: Add support for BGR and rgb(a) reversed formats (Not available for GLES). General cleanup and commenting.
svn-id: r51559
Diffstat (limited to 'backends/graphics/opengl/gltexture.cpp')
-rw-r--r-- | backends/graphics/opengl/gltexture.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp index 79e7cd48f0..e43cbe2266 100644 --- a/backends/graphics/opengl/gltexture.cpp +++ b/backends/graphics/opengl/gltexture.cpp @@ -56,7 +56,7 @@ static GLuint nextHigher2(GLuint v) { void GLTexture::initGLExtensions() { static bool inited = false; - // Return if extensions already checked + // Return if extensions were already checked if (inited) return; @@ -75,9 +75,10 @@ void GLTexture::initGLExtensions() { inited = true; } -GLTexture::GLTexture(byte bpp, GLenum format, GLenum type) +GLTexture::GLTexture(byte bpp, GLenum internalFormat, GLenum format, GLenum type) : _bytesPerPixel(bpp), + _internalFormat(internalFormat), _glFormat(format), _glType(type), _textureWidth(0), @@ -131,7 +132,7 @@ void GLTexture::allocBuffer(GLuint w, GLuint h) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); CHECK_GL_ERROR(); // Allocate room for the texture - glTexImage2D(GL_TEXTURE_2D, 0, _glFormat, + glTexImage2D(GL_TEXTURE_2D, 0, _internalFormat, _textureWidth, _textureHeight, 0, _glFormat, _glType, NULL); CHECK_GL_ERROR(); _refresh = false; |