@@ -405,10 +405,8 @@ void gr_opengl_shutdown()
405405
406406 GL_initted = false ;
407407
408- if ( GL_version >= 30 ) {
409- glDeleteVertexArrays (1 , &GL_vao);
410- GL_vao = 0 ;
411- }
408+ glDeleteVertexArrays (1 , &GL_vao);
409+ GL_vao = 0 ;
412410
413411 if (GL_original_gamma_ramp != NULL && os::getSDLMainWindow () != nullptr ) {
414412 SDL_SetWindowGammaRamp ( os::getSDLMainWindow (), GL_original_gamma_ramp, (GL_original_gamma_ramp+256 ), (GL_original_gamma_ramp+512 ) );
@@ -1433,12 +1431,6 @@ static void init_extensions() {
14331431 Error (LOCATION, " Current GL Shading Langauge Version of %d is less than the required version of %d. Switch video modes or update your drivers." , GLSL_version, MIN_REQUIRED_GLSL_VERSION);
14341432 }
14351433
1436- if ( GLSL_version < 120 ) {
1437- mprintf ((" No hardware support for deferred lighting. Deferred lighting will be disabled. \n " ));
1438- Cmdline_no_deferred_lighting = 1 ;
1439- Cmdline_no_batching = true ;
1440- }
1441-
14421434 GLint max_texture_units;
14431435 glGetIntegerv (GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_units);
14441436
@@ -1452,8 +1444,7 @@ static void init_extensions() {
14521444 Cmdline_normal = 0 ;
14531445 Cmdline_height = 0 ;
14541446 } else if (max_texture_units < 4 ) {
1455- mprintf (( " Not enough texture units found for GLSL support. We need at least 4, we found %d.\n " , max_texture_units ));
1456- GLSL_version = 0 ;
1447+ Error (LOCATION, " Not enough texture units found for proper rendering support! We need at least 4, we found %d." , max_texture_units);
14571448 }
14581449}
14591450
@@ -1542,11 +1533,9 @@ bool gr_opengl_init(std::unique_ptr<os::GraphicsOperations>&& graphicsOps)
15421533 glGetIntegerv (GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_units);
15431534 max_texture_coords = 1 ;
15441535
1545- // create vertex array object to make OpenGL Core happy if we can
1546- if ( GL_version >= 30 ) {
1547- glGenVertexArrays (1 , &GL_vao);
1548- glBindVertexArray (GL_vao);
1549- }
1536+ // create vertex array object to make OpenGL Core happy
1537+ glGenVertexArrays (1 , &GL_vao);
1538+ glBindVertexArray (GL_vao);
15501539
15511540 GL_state.Texture .init (max_texture_units);
15521541 GL_state.Array .init (max_texture_coords);
@@ -1632,10 +1621,6 @@ bool gr_opengl_init(std::unique_ptr<os::GraphicsOperations>&& graphicsOps)
16321621
16331622bool gr_opengl_is_capable (gr_capability capability)
16341623{
1635- if ( GL_version < 20 ) {
1636- return false ;
1637- }
1638-
16391624 switch ( capability ) {
16401625 case CAPABILITY_ENVIRONMENT_MAP:
16411626 return true ;
@@ -1645,17 +1630,17 @@ bool gr_opengl_is_capable(gr_capability capability)
16451630 return Cmdline_height ? true : false ;
16461631 case CAPABILITY_SOFT_PARTICLES:
16471632 case CAPABILITY_DISTORTION:
1648- return Cmdline_softparticles && (GLSL_version >= 120 ) && !Cmdline_no_fbo;
1633+ return Cmdline_softparticles && !Cmdline_no_fbo;
16491634 case CAPABILITY_POST_PROCESSING:
1650- return Cmdline_postprocess && (GLSL_version >= 120 ) && !Cmdline_no_fbo;
1635+ return Cmdline_postprocess && !Cmdline_no_fbo;
16511636 case CAPABILITY_DEFERRED_LIGHTING:
1652- return !Cmdline_no_fbo && !Cmdline_no_deferred_lighting && (GLSL_version >= 120 ) ;
1637+ return !Cmdline_no_fbo && !Cmdline_no_deferred_lighting;
16531638 case CAPABILITY_SHADOWS:
1654- return GL_version >= 32 ;
1639+ return true ;
16551640 case CAPABILITY_BATCHED_SUBMODELS:
1656- return (GLSL_version >= 150 ) ;
1641+ return true ;
16571642 case CAPABILITY_POINT_PARTICLES:
1658- return GL_version >= 32 && !Cmdline_no_geo_sdr_effects;
1643+ return !Cmdline_no_geo_sdr_effects;
16591644 case CAPABILITY_TIMESTAMP_QUERY:
16601645 return GL_version >= 33 ; // Timestamp queries are available from 3.3 onwards
16611646 }
0 commit comments