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.16 by root, Thu Nov 26 07:19:12 2009 UTC vs.
Revision 1.20 by root, Tue Dec 22 01:38:53 2009 UTC

9our $GL_VERSION; 9our $GL_VERSION;
10 10
11our $GL_NPOT; 11our $GL_NPOT;
12our $GL_COMPRESS; 12our $GL_COMPRESS;
13our $GL_BFSEP; # blendfuncseparate 13our $GL_BFSEP; # blendfuncseparate
14our $GL_MULTITEX;
14our $APPLE_NVIDIA_BUG; 15our $APPLE_NVIDIA_BUG;
15 16
16our $DEBUG = 1; 17our $DEBUG = 1;
17our %INIT_HOOK; 18our %INIT_HOOK;
18our %SHUTDOWN_HOOK; 19our %SHUTDOWN_HOOK;
38 # try to find a suitable default 39 # try to find a suitable default
39 if ( 40 if (
40 $GL_VERSION >= 2.0 41 $GL_VERSION >= 2.0
41 && (!$GL_EXT{GL_ARB_texture_non_power_of_two} 42 && (!$GL_EXT{GL_ARB_texture_non_power_of_two}
42 || !$GL_EXT{GL_EXT_blend_func_separate}) 43 || !$GL_EXT{GL_EXT_blend_func_separate})
43 ) { 44 ) {
44 $::CFG->{force_opengl11} = 1; 45 $::CFG->{force_opengl11} = 1;
45 } else { 46 } else {
46 $::CFG->{force_opengl11} = 0; 47 $::CFG->{force_opengl11} = 0;
47 } 48 }
48 } 49 }
49 50
50 if ($::CFG->{force_opengl11}) { 51 if ($::CFG->{force_opengl11}) {
51 $GL_VERSION = 1.1; 52 $GL_VERSION = 1.1;
52 %GL_EXT = (); 53 %GL_EXT = ();
53 } 54 }
54 55
55 $GL_BFSEP = $GL_EXT{GL_EXT_blend_func_separate} || $GL_VERSION >= 2.0; 56 $GL_BFSEP = $GL_EXT{GL_EXT_blend_func_separate} || $GL_VERSION >= 2.0;
56 $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2.0; 57 $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2.0;
57 $GL_COMPRESS = $GL_EXT{GL_ARB_texture_compression} || $GL_VERSION >= 1.3; 58 $GL_COMPRESS = $GL_EXT{GL_ARB_texture_compression} || $GL_VERSION >= 1.3;
59 $GL_MULTITEX = $GL_EXT{GL_ARB_multitexture} || $GL_VERSION >= 1.3;
60 $GL_MULTITEX &&= 2 <= glGetInteger GL_MAX_TEXTURE_UNITS;
58 61
59 $GL_COMPRESS = 0 if DC::OpenGL::gl_vendor eq "Apple Computer, Inc."; # there is no end to their suckage 62 $GL_COMPRESS = 0 if DC::OpenGL::gl_vendor eq "Apple Computer, Inc."; # there is no end to their suckage
60 63
61 $APPLE_NVIDIA_BUG = DC::OpenGL::gl_vendor eq "NVIDIA Corporation" && $^O eq "darwin"; 64 $APPLE_NVIDIA_BUG = DC::OpenGL::gl_vendor eq "NVIDIA Corporation" && $^O eq "darwin";
62 apple_nvidia_bug $APPLE_NVIDIA_BUG; 65 apple_nvidia_bug $APPLE_NVIDIA_BUG;
78 glHint GL_GENERATE_MIPMAP_HINT , $hint; 81 glHint GL_GENERATE_MIPMAP_HINT , $hint;
79 glHint GL_TEXTURE_COMPRESSION_HINT , $hint; 82 glHint GL_TEXTURE_COMPRESSION_HINT , $hint;
80 #glDrawBuffer GL_BACK; 83 #glDrawBuffer GL_BACK;
81 #glReadBuffer GL_BACK; 84 #glReadBuffer GL_BACK;
82 85
86 c_init;
83 $_->() for values %INIT_HOOK; 87 $_->() for values %INIT_HOOK;
84} 88}
85 89
86sub quit { 90sub quit {
87 undef $GL_VERSION; 91 undef $GL_VERSION;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines