OpenGL2: Don't segfault if r_ext_multitexture is disabled

This commit is contained in:
Zack Middleton 2014-09-29 00:35:03 -05:00
parent 0e5835a86e
commit 918eed9295
2 changed files with 8 additions and 3 deletions

View file

@ -77,6 +77,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;
@ -1653,7 +1656,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);