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

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.53 by root, Wed May 17 16:17:01 2006 UTC vs.
Revision 1.56 by root, Fri May 19 23:18:40 2006 UTC

50 50
51sub gl_check { 51sub gl_check {
52 return unless $GL_DEBUG; 52 return unless $GL_DEBUG;
53 53
54 if (my $error = glGetError) { 54 if (my $error = glGetError) {
55 Carp::cluck sprintf "opengl error %x while %s", $error, sprintf @_; 55 Carp::cluck sprintf "opengl error %x while %s", $error, &sprintf(@_);
56 } 56 }
57} 57}
58 58
59sub find_rcfile($) { 59sub find_rcfile($) {
60 my $path; 60 my $path;
355 glGetError; 355 glGetError;
356 356
357 if (defined $data) { 357 if (defined $data) {
358 glTexImage2D GL_TEXTURE_2D, 0, 358 glTexImage2D GL_TEXTURE_2D, 0,
359 $self->{internalformat}, 359 $self->{internalformat},
360 $tw, $th, # need to pad texture first 360 $tw, $th,
361 0, 361 0,
362 $self->{format}, 362 $self->{format},
363 $self->{type}, 363 $self->{type},
364 $data; 364 $data;
365 CFClient::gl_check "uploading texture %dx%d if=%x f=%x t=%x", 365 CFClient::gl_check "uploading texture %dx%d if=%x f=%x t=%x",
371 $tw, $th, 371 $tw, $th,
372 0; 372 0;
373 CFClient::gl_check "copying to texture %dx%d if=%x", 373 CFClient::gl_check "copying to texture %dx%d if=%x",
374 $tw, $th, $self->{internalformat}; 374 $tw, $th, $self->{internalformat};
375 } 375 }
376
377 glBindTexture GL_TEXTURE_2D, 0; # just to be on the safe side
376} 378}
377 379
378sub DESTROY { 380sub DESTROY {
379 my ($self) = @_; 381 my ($self) = @_;
380 382
382 384
383 glDeleteTexture delete $self->{name} 385 glDeleteTexture delete $self->{name}
384 if $self->{name}; 386 if $self->{name};
385} 387}
386 388
387sub restore_state{ 389sub restore_state {
388 $_->upload 390 $_->upload
389 for values %TEXTURES; 391 for values %TEXTURES;
390}; 392}
391 393
3921; 3941;
393 395
394=back 396=back
395 397

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines