--- deliantra/Deliantra-Client/DC/UI.pm 2006/04/08 18:15:59 1.21 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/04/08 18:18:09 1.22 @@ -133,11 +133,15 @@ my $chld = $self->get; my ($w, $h) = $self->size_request; + $w = $h = 256; + $self->{texture} = Crossfire::Client::Texture->new_from_opengl ( $w, $h, sub { - my ($txt, $w, $h) = @_; + glPushMatrix; + glLoadIdentity; $chld->_draw; + glPopMatrix; } ); $self->{texture}->upload; @@ -153,10 +157,10 @@ sub _draw { my ($self) = @_; + my ($w, $h) = $self->size_request; my $tex = $self->{texture} or return; - warn "DRAW TEX: $tex->{width} $tex->{height}\n"; glEnable GL_BLEND; glEnable GL_TEXTURE_2D; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; @@ -166,9 +170,9 @@ glBegin GL_QUADS; glTexCoord 0, 0; glVertex 0 , 0; - glTexCoord 0, 1; glVertex 0 , $tex->{height}; - glTexCoord 1, 1; glVertex $tex->{width}, $tex->{height}; - glTexCoord 1, 0; glVertex $tex->{width}, 0; + glTexCoord 0, 1; glVertex 0 , $h; + glTexCoord 1, 1; glVertex $w , $h; + glTexCoord 1, 0; glVertex $w , 0; glEnd; glDisable GL_BLEND;