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

Comparing deliantra/Deliantra-Client/DC/Texture.pm (file contents):
Revision 1.7 by root, Thu Jun 15 15:33:58 2006 UTC vs.
Revision 1.8 by root, Sat Jun 17 15:07:53 2006 UTC

171 gl_check "copying to texture %dx%d if=%x", 171 gl_check "copying to texture %dx%d if=%x",
172 $tw, $th, $self->{internalformat}; 172 $tw, $th, $self->{internalformat};
173 } 173 }
174} 174}
175 175
176sub shutdown {
177 my ($self) = @_;
178
179 glDeleteTexture delete $self->{name}
180 if $self->{name};
181}
182
176sub DESTROY { 183sub DESTROY {
177 my ($self) = @_; 184 my ($self) = @_;
178 185
179 delete $TEXTURES{$self+0}; 186 delete $TEXTURES{$self+0};
180 187
181 glDeleteTexture delete $self->{name} 188 $self->shutdown;
182 if $self->{name};
183} 189}
184 190
185$CFClient::OpenGL::INIT_HOOK{"CFClient::Texture"} = sub { 191$CFClient::OpenGL::INIT_HOOK{"CFClient::Texture"} = sub {
186 $_->upload 192 $_->upload
187 for values %TEXTURES; 193 for values %TEXTURES;
188}; 194};
189 195
196$CFClient::OpenGL::SHUTDOWN_HOOK{"CFClient::Texture"} = sub {
197 $_->shutdown
198 for values %TEXTURES;
199};
200
1901; 2011;
191 202
192=back 203=back
193 204
194=head1 AUTHOR 205=head1 AUTHOR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines