Skip to content

Commit

Permalink
Add support for GL_BGRA pixel format if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Nov 14, 2012
1 parent 48165bc commit ce5394f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions source/Client/Graphics/TextureManager.cpp
Expand Up @@ -15,7 +15,7 @@ namespace Dream {
using Imaging::PixelFormat;

switch (pixel_format) {
#ifdef DREAM_OPENGLES2
#if defined(DREAM_OPENGLES2)
case PixelFormat::R:
case PixelFormat::G:
case PixelFormat::B:
Expand All @@ -29,14 +29,14 @@ namespace Dream {
return GL_BLUE;
#endif
case PixelFormat::L:
#ifdef GL_LUMINANCE
#if defined(GL_LUMINANCE)
return GL_LUMINANCE;
#else
return GL_RED;
#endif

case PixelFormat::LA:
#ifdef GL_LUMINANCE_ALPHA
#if defined(GL_LUMINANCE_ALPHA)
return GL_LUMINANCE_ALPHA;
#else
return GL_RG;
Expand All @@ -49,6 +49,13 @@ namespace Dream {
case PixelFormat::RGBA:
return GL_RGBA;

#if defined(GL_BGRA)
case PixelFormat::BGRA:
return GL_BGRA;
#elif defined(GL_BGRA_EXT)
return GL_BGRA_EXT;
#endif

default:
return GL_INVALID_ENUM;
}
Expand Down

0 comments on commit ce5394f

Please sign in to comment.