… | |
… | |
41 | |
41 | |
42 | glDisable GL_COLOR_MATERIAL; |
42 | glDisable GL_COLOR_MATERIAL; |
43 | glShadeModel GL_FLAT; |
43 | glShadeModel GL_FLAT; |
44 | glDisable GL_DITHER; |
44 | glDisable GL_DITHER; |
45 | glDisable GL_DEPTH_TEST; |
45 | glDisable GL_DEPTH_TEST; |
|
|
46 | glDepthMask 0; |
46 | glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST; |
47 | glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST; |
47 | |
48 | |
48 | CFClient::Texture::restore_state (); |
49 | CFClient::Texture::restore_state (); |
49 | } |
50 | } |
50 | |
51 | |
51 | sub gl_check { |
52 | sub gl_check { |
52 | return unless $GL_DEBUG; |
53 | return unless $GL_DEBUG; |
53 | |
54 | |
54 | if (my $error = glGetError) { |
55 | if (my $error = glGetError) { |
55 | Carp::cluck sprintf "opengl error %x while %s", $error, sprintf @_; |
56 | Carp::cluck sprintf "opengl error %x while %s", $error, &sprintf(@_); |
56 | } |
57 | } |
57 | } |
58 | } |
58 | |
59 | |
59 | sub find_rcfile($) { |
60 | sub find_rcfile($) { |
60 | my $path; |
61 | my $path; |
… | |
… | |
371 | $tw, $th, |
372 | $tw, $th, |
372 | 0; |
373 | 0; |
373 | CFClient::gl_check "copying to texture %dx%d if=%x", |
374 | CFClient::gl_check "copying to texture %dx%d if=%x", |
374 | $tw, $th, $self->{internalformat}; |
375 | $tw, $th, $self->{internalformat}; |
375 | } |
376 | } |
|
|
377 | |
|
|
378 | glBindTexture GL_TEXTURE_2D, 0; # just to be on the safe side |
376 | } |
379 | } |
377 | |
380 | |
378 | sub DESTROY { |
381 | sub DESTROY { |
379 | my ($self) = @_; |
382 | my ($self) = @_; |
380 | |
383 | |