Skip to content

Commit bb5b72b

Browse files
committed
Minor Fixes
1 parent 8e7ac0d commit bb5b72b

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

librtt/Renderer/Rtt_GLTexture.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
#define DEBUG_PRINT( ... )
2828
#endif
2929

30-
#if !defined(Rtt_OPENGLES) && !defined(GL_ABGR_EXT)
31-
#define GL_ABGR_EXT 0x8000
32-
#endif
33-
3430
// ----------------------------------------------------------------------------
3531

3632
namespace /*anonymous*/
@@ -54,7 +50,13 @@ namespace /*anonymous*/
5450
#elif !defined( Rtt_OPENGLES )
5551
case Texture::kARGB: internalFormat = GL_RGBA8; sourceFormat = GL_BGRA; sourceType = GL_UNSIGNED_INT_8_8_8_8_REV; break;
5652
case Texture::kBGRA: internalFormat = GL_RGBA8; sourceFormat = GL_BGRA; sourceType = GL_UNSIGNED_INT_8_8_8_8; break;
57-
case Texture::kABGR: internalFormat = GL_ABGR_EXT; sourceFormat = GL_ABGR_EXT; sourceType = GL_UNSIGNED_BYTE; break;
53+
#ifdef GL_ABGR_EXT
54+
case Texture::kABGR:
55+
internalFormat = GL_ABGR_EXT;
56+
sourceFormat = GL_ABGR_EXT;
57+
sourceType = GL_UNSIGNED_BYTE;
58+
break;
59+
#endif
5860
#else
5961
// NOTE: These are not available on OpenGL-ES
6062
// case Texture::kARGB: internalFormat = GL_RGBA; sourceFormat = GL_RGBA; sourceType = GL_UNSIGNED_BYTE; break;
@@ -119,12 +121,15 @@ GLint CalculateOptimalAlignment(U32 width, GLenum format)
119121
bytesPerPixel = 3;
120122
break;
121123

122-
case GL_RGBA:
123-
case GL_BGRA_EXT:
124+
125+
#if defined(GL_ABGR_EXT)
124126
case GL_ABGR_EXT:
127+
#endif
128+
case GL_RGBA:
125129
bytesPerPixel = 4;
126130
break;
127131

132+
case GL_ABGR_EXT:
128133
#ifdef Rtt_NXS_ENV
129134
case GL_LUMINANCE_ALPHA:
130135
bytesPerPixel = 2;

0 commit comments

Comments
 (0)