From 502d5b81898df2420cdc3601c1cb6d711844eaa5 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 29 Sep 2014 00:35:03 -0500 Subject: OpenGL2: Don't segfault if r_ext_multitexture is disabled --- src/renderergl2/tr_backend.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/renderergl2/tr_backend.c') 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); -- cgit