Skip to content

Commit

Permalink
OpenGL2: Disable r_cubeMapping if not OpenGL 3.0+
Browse files Browse the repository at this point in the history
r_cubeMapping requires textureCubeLod() which is only in OpenGL 3.0
(GLSL 1.30) and later. It's not in OpenGL ES 3.0 / GLSL ES 3.00.
This needs to be checked before R_InitImages() so can't just check in
GLSL_InitGPUShaders().
  • Loading branch information
zturtleman committed Apr 16, 2019
1 parent 9fcb2bb commit d13d064
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/renderergl2/tr_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ static void InitOpenGL( void )
}
}

// check for GLSL function textureCubeLod()
if ( r_cubeMapping->integer && !QGL_VERSION_ATLEAST( 3, 0 ) ) {
ri.Printf( PRINT_WARNING, "WARNING: Disabled r_cubeMapping because it requires OpenGL 3.0\n" );
ri.Cvar_Set( "r_cubeMapping", "0" );
}

// set default state
GL_SetDefaultState();
}
Expand Down

0 comments on commit d13d064

Please sign in to comment.