ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/OpenGL.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/OpenGL.pm (file contents):
Revision 1.7 by root, Thu Aug 9 05:38:30 2007 UTC vs.
Revision 1.10 by root, Sun Aug 19 14:09:28 2007 UTC

7 7
8our %GL_EXT; 8our %GL_EXT;
9our $GL_VERSION; 9our $GL_VERSION;
10 10
11our $GL_NPOT; 11our $GL_NPOT;
12our $GL_COMPRESS;
13our $GL_BFSEP; # blendfuncseparate
12 14
13our $DEBUG = 1; 15our $DEBUG = 1;
14our %INIT_HOOK; 16our %INIT_HOOK;
15our %SHUTDOWN_HOOK; 17our %SHUTDOWN_HOOK;
16 18
29 31
30sub init { 32sub init {
31 $GL_VERSION = gl_version * 1; 33 $GL_VERSION = gl_version * 1;
32 %GL_EXT = map +($_ => 1), split /\s+/, gl_extensions; 34 %GL_EXT = map +($_ => 1), split /\s+/, gl_extensions;
33 35
36 unless (defined $::CFG->{force_opengl11}) {
37 # try to find a suitable default
38 if (
39 $GL_VERSION >= 2.0
40 && (!$GL_EXT{GL_ARB_texture_non_power_of_two}
41 || !$GL_EXT{GL_EXT_blend_func_separate})
42 ) {
43 $::CFG->{force_opengl11} = 1;
44 } else {
45 $::CFG->{force_opengl11} = 0;
46 }
47 }
48
49 if ($::CFG->{force_opengl11}) {
50 $GL_VERSION = 1.1;
51 %GL_EXT = ();
52 }
53
54 $GL_BFSEP = $GL_EXT{GL_EXT_blend_func_separate} || $GL_VERSION >= 2.0;
34# $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2; 55 $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2.0;
35 $GL_NPOT = $GL_VERSION >= 2; # some pre-2.0 cards seem to fall back to software rendering 56 $GL_COMPRESS = $GL_EXT{GL_ARB_texture_compression} || $GL_VERSION >= 1.3;
36 $GL_NPOT = 0 if gl_vendor =~ /ATI Technologies/; # ATI doesn't get it right... 57
58 disable_GL_EXT_blend_func_separate
59 unless $GL_BFSEP;
37 60
38 glDisable GL_COLOR_MATERIAL; 61 glDisable GL_COLOR_MATERIAL;
39 glShadeModel GL_FLAT; 62 glShadeModel GL_FLAT;
40 glDisable GL_DITHER; 63 glDisable GL_DITHER;
41 glDisable GL_DEPTH_TEST; 64 glDisable GL_DEPTH_TEST;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines