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

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.174 by root, Tue Apr 25 11:18:49 2006 UTC vs.
Revision 1.175 by root, Tue Apr 25 11:48:31 2006 UTC

669 669
670 $self->{texture} = new_from_opengl CFClient::Texture $self->{w}, $self->{h}, sub { 670 $self->{texture} = new_from_opengl CFClient::Texture $self->{w}, $self->{h}, sub {
671 glClearColor 0, 0, 0, 0; 671 glClearColor 0, 0, 0, 0;
672 glClear GL_COLOR_BUFFER_BIT; 672 glClear GL_COLOR_BUFFER_BIT;
673 $self->child->draw; 673 $self->child->draw;
674# glColorMask 1, 1, 1, 0;
675# glEnable GL_BLEND;
676# glBlendFunc GL_SRC_ALPHA, GL_ZERO;
677# glRasterPos 0, 0;
678# glCopyPixels 0, 0, $self->{w}, $self->{h};
679# glDisable GL_BLEND;
680# glColorMask 1, 1, 1, 1;
674 }; 681 };
675} 682}
676 683
677sub _draw { 684sub _draw {
678 my ($self) = @_; 685 my ($self) = @_;
2160 2167
2161 delete $self->{texture}; 2168 delete $self->{texture};
2162 } 2169 }
2163 2170
2164 $self->{texture} ||= new_from_opengl CFClient::Texture $self->{w}, $self->{h}, sub { 2171 $self->{texture} ||= new_from_opengl CFClient::Texture $self->{w}, $self->{h}, sub {
2165 glClearColor 0, 0, 0, 1; 2172 glClearColor 0, 0, 0, 0;
2166 glClear GL_COLOR_BUFFER_BIT; 2173 glClear GL_COLOR_BUFFER_BIT;
2167 2174
2168 glEnable GL_BLEND; 2175 glEnable GL_BLEND;
2169 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 2176 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
2170 glEnable GL_TEXTURE_2D; 2177 glEnable GL_TEXTURE_2D;
2203 2210
2204sub _draw { 2211sub _draw {
2205 my ($self) = @_; 2212 my ($self) = @_;
2206 2213
2207 if ($self->{texture}) { 2214 if ($self->{texture}) {
2215 glEnable GL_BLEND;
2216 glBlendFunc GL_ONE, GL_ONE_MINUS_SRC_ALPHA;
2208 glEnable GL_TEXTURE_2D; 2217 glEnable GL_TEXTURE_2D;
2209 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE; 2218 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE;
2210 glColor 1, 1, 1, 1; 2219 glColor 1, 1, 1, 1;
2211 $self->{texture}->draw_quad (0, 0, $self->{w}, $self->{h}); 2220 $self->{texture}->draw_quad (0, 0, $self->{w}, $self->{h});
2212 glDisable GL_TEXTURE_2D; 2221 glDisable GL_TEXTURE_2D;
2222 glDisable GL_BLEND;
2213 } 2223 }
2214 2224
2215 $self->{children}[1]->draw; 2225 $self->{children}[1]->draw;
2216 2226
2217} 2227}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines