summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_backend.c
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2014-09-29 00:35:03 -0500
committerTim Angus <tim@ngus.net>2015-03-17 11:38:47 +0000
commit502d5b81898df2420cdc3601c1cb6d711844eaa5 (patch)
tree9a47b5fa658286323be07e5d124a4c0e423f4af4 /src/renderergl2/tr_backend.c
parentc1d82cb348c1a34224be58649760422ba7f43dd0 (diff)
OpenGL2: Don't segfault if r_ext_multitexture is disabled
Diffstat (limited to 'src/renderergl2/tr_backend.c')
-rw-r--r--src/renderergl2/tr_backend.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/renderergl2/tr_backend.c b/src/renderergl2/tr_backend.c
index 964da39a..2ba52f69 100644
--- a/src/renderergl2/tr_backend.c
+++ b/src/renderergl2/tr_backend.c
@@ -78,6 +78,9 @@ void GL_SelectTexture( int unit )
if (!(unit >= 0 && unit <= 31))
ri.Error( ERR_DROP, "GL_SelectTexture: unit = %i", unit );
+ if (!qglActiveTextureARB)
+ ri.Error( ERR_DROP, "GL_SelectTexture: multitexture disabled" );
+
qglActiveTextureARB( GL_TEXTURE0_ARB + unit );
glState.currenttmu = unit;
@@ -1654,7 +1657,7 @@ const void *RB_PostProcess(const void *data)
if (srcFbo)
{
- if (r_hdr->integer && (r_toneMap->integer || r_forceToneMap->integer))
+ if (r_hdr->integer && (r_toneMap->integer || r_forceToneMap->integer) && qglActiveTextureARB)
{
autoExposure = r_autoExposure->integer || r_forceAutoExposure->integer;
RB_ToneMap(srcFbo, srcBox, NULL, dstBox, autoExposure);