--- deliantra/Deliantra-Client/DC/OpenGL.pm 2007/08/19 12:56:24 1.9 +++ deliantra/Deliantra-Client/DC/OpenGL.pm 2007/08/19 14:09:28 1.10 @@ -10,6 +10,7 @@ our $GL_NPOT; our $GL_COMPRESS; +our $GL_BFSEP; # blendfuncseparate our $DEBUG = 1; our %INIT_HOOK; @@ -29,17 +30,34 @@ } sub init { + $GL_VERSION = gl_version * 1; + %GL_EXT = map +($_ => 1), split /\s+/, gl_extensions; + + unless (defined $::CFG->{force_opengl11}) { + # try to find a suitable default + if ( + $GL_VERSION >= 2.0 + && (!$GL_EXT{GL_ARB_texture_non_power_of_two} + || !$GL_EXT{GL_EXT_blend_func_separate}) + ) { + $::CFG->{force_opengl11} = 1; + } else { + $::CFG->{force_opengl11} = 0; + } + } + if ($::CFG->{force_opengl11}) { $GL_VERSION = 1.1; %GL_EXT = (); - } else { - $GL_VERSION = gl_version * 1; - %GL_EXT = map +($_ => 1), split /\s+/, gl_extensions; } + $GL_BFSEP = $GL_EXT{GL_EXT_blend_func_separate} || $GL_VERSION >= 2.0; $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2.0; $GL_COMPRESS = $GL_EXT{GL_ARB_texture_compression} || $GL_VERSION >= 1.3; + disable_GL_EXT_blend_func_separate + unless $GL_BFSEP; + glDisable GL_COLOR_MATERIAL; glShadeModel GL_FLAT; glDisable GL_DITHER;