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.31 by root, Wed Dec 26 21:03:21 2007 UTC vs.
Revision 1.32 by root, Thu Dec 27 20:38:49 2007 UTC

324 324
325 $self->unload; 325 $self->unload;
326} 326}
327 327
328$DC::OpenGL::INIT_HOOK{"DC::Texture"} = sub { 328$DC::OpenGL::INIT_HOOK{"DC::Texture"} = sub {
329 for (values %TEXTURES) { 329 for my $tex (values %TEXTURES) {
330 $_->upload if $_->{want_upload}; 330 if (my $name = $tex->{want_upload}) {
331 $tex->upload;
332
333 if ($tex->{loading} && $name > 0) {
334 # if loading is delayed we still have to allocate the texture name
335 glBindTexture GL_TEXTURE_2D, $name;
336 glTexImage2D GL_TEXTURE_2D, 0, GL_ALPHA, 0, 0, 0, GL_ALPHA, GL_UNSIGNED_BYTE;
337 }
338 }
331 } 339 }
332}; 340};
333 341
334$DC::OpenGL::SHUTDOWN_HOOK{"DC::Texture"} = sub { 342$DC::OpenGL::SHUTDOWN_HOOK{"DC::Texture"} = sub {
335 for (values %TEXTURES) { 343 for (values %TEXTURES) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines