Merge pull request #243 from unknownbrackets/texformats

Swap R/B in a few other texture formats
This commit is contained in:
B1ackDaemon 2014-05-18 11:08:12 +03:00
commit 1a6fa4aedc

View File

@ -121,7 +121,7 @@ public:
checkForGlError("GLTexture::Init() -> glPixelStorei");
// TODO: texture swizzling
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels);
checkForGlError("GLTexture::Init() -> glTexImage2D");
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
@ -313,7 +313,7 @@ public:
checkForGlError("GLTexture::Init() -> glPixelStorei");
// TODO: Texture swizzling
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixels);
checkForGlError("GLTexture::Init() -> glTexImage2D");
static const GLint swizzleMaskX32_D1R5G5B5[] = { GL_ONE, GL_RED, GL_GREEN, GL_BLUE };