summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2018-05-20 00:41:12 +0200
committerraysan5 <[email protected]>2018-05-20 00:41:12 +0200
commit3b70b66a089ed48b99305ce058a4bbde4a0bc3b4 (patch)
tree702ba9c414fe6dd5465c93c16582584b57bb9511 /src/rlgl.c
parent24adca4ad054196a144eca8629e090ee10e413c5 (diff)
downloadraylib-3b70b66a089ed48b99305ce058a4bbde4a0bc3b4.tar.gz
raylib-3b70b66a089ed48b99305ce058a4bbde4a0bc3b4.zip
Love OpenGL gotchas... make my life more enjoyable!
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index e69694e9..f83a9f6b 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -1456,7 +1456,11 @@ unsigned int rlLoadTexture(void *data, int width, int height, int format, int mi
}
else if (format == UNCOMPRESSED_GRAY_ALPHA)
{
+ #if defined(GRAPHICS_API_OPENGL_21)
+ GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_ALPHA };
+ #elif defined(GRAPHICS_API_OPENGL_33)
GLint swizzleMask[] = { GL_RED, GL_RED, GL_RED, GL_GREEN };
+ #endif
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
}
#endif