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.10 by root, Sun Aug 19 14:09:28 2007 UTC vs.
Revision 1.15 by root, Sat Aug 30 04:43:02 2008 UTC

1package CFPlus::OpenGL; 1package DC::OpenGL;
2 2
3use strict; 3use strict;
4 4
5use Carp (); 5use Carp ();
6use CFPlus; 6use DC;
7 7
8our %GL_EXT; 8our %GL_EXT;
9our $GL_VERSION; 9our $GL_VERSION;
10 10
11our $GL_NPOT; 11our $GL_NPOT;
19sub import { 19sub import {
20 my $caller = caller; 20 my $caller = caller;
21 21
22 no strict; 22 no strict;
23 23
24 my $symtab = *{"main::CFPlus::OpenGL::"}{HASH}; 24 my $symtab = *{"main::DC::OpenGL::"}{HASH};
25 25
26 for (keys %$symtab) { 26 for (keys %$symtab) {
27 *{"$caller\::$_"} = *$_ 27 *{"$caller\::$_"} = *$_
28 if /^(?:gl[A-Z_]|GL_)/; 28 if /^(?:gl[A-Z_]|GL_)/;
29 } 29 }
53 53
54 $GL_BFSEP = $GL_EXT{GL_EXT_blend_func_separate} || $GL_VERSION >= 2.0; 54 $GL_BFSEP = $GL_EXT{GL_EXT_blend_func_separate} || $GL_VERSION >= 2.0;
55 $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2.0; 55 $GL_NPOT = $GL_EXT{GL_ARB_texture_non_power_of_two} || $GL_VERSION >= 2.0;
56 $GL_COMPRESS = $GL_EXT{GL_ARB_texture_compression} || $GL_VERSION >= 1.3; 56 $GL_COMPRESS = $GL_EXT{GL_ARB_texture_compression} || $GL_VERSION >= 1.3;
57 57
58 $GL_COMPRESS = 0 if DC::OpenGL::gl_vendor eq "Apple Computer, Inc."; # there is no end to their suckage
59
58 disable_GL_EXT_blend_func_separate 60 disable_GL_EXT_blend_func_separate
59 unless $GL_BFSEP; 61 unless $GL_BFSEP;
60 62
61 glDisable GL_COLOR_MATERIAL; 63 glDisable GL_COLOR_MATERIAL;
62 glShadeModel GL_FLAT; 64 glShadeModel GL_FLAT;
68 glHint GL_PERSPECTIVE_CORRECTION_HINT, $hint; 70 glHint GL_PERSPECTIVE_CORRECTION_HINT, $hint;
69 glHint GL_POINT_SMOOTH_HINT , $hint; 71 glHint GL_POINT_SMOOTH_HINT , $hint;
70 glHint GL_LINE_SMOOTH_HINT , $hint; 72 glHint GL_LINE_SMOOTH_HINT , $hint;
71 glHint GL_POLYGON_SMOOTH_HINT , $hint; 73 glHint GL_POLYGON_SMOOTH_HINT , $hint;
72 glHint GL_GENERATE_MIPMAP_HINT , $hint; 74 glHint GL_GENERATE_MIPMAP_HINT , $hint;
75 glHint GL_TEXTURE_COMPRESSION_HINT , $hint;
73 #glDrawBuffer GL_BACK; 76 #glDrawBuffer GL_BACK;
74 #glReadBuffer GL_BACK; 77 #glReadBuffer GL_BACK;
75 78
76 $_->() for values %INIT_HOOK; 79 $_->() for values %INIT_HOOK;
77} 80}
78 81
82sub quit {
83 undef $GL_VERSION;
84 undef %GL_EXT;
85}
86
79sub shutdown { 87sub shutdown {
80 $_->() for values %SHUTDOWN_HOOK; 88 $_->() for values %SHUTDOWN_HOOK;
89
90 quit;
81} 91}
82 92
83sub gl_check { 93sub gl_check {
84 return unless $DEBUG; 94 return unless $DEBUG;
85 95

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines