--- deliantra/Deliantra-Client/DC/UI.pm 2006/04/08 18:18:09 1.22 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/04/08 18:48:34 1.23 @@ -133,16 +133,9 @@ my $chld = $self->get; my ($w, $h) = $self->size_request; - $w = $h = 256; - $self->{texture} = Crossfire::Client::Texture->new_from_opengl ( - $w, $h, sub { - glPushMatrix; - glLoadIdentity; - $chld->_draw; - glPopMatrix; - } + $w, $h, sub { $chld->draw } ); $self->{texture}->upload; } @@ -157,7 +150,7 @@ sub _draw { my ($self) = @_; - my ($w, $h) = $self->size_request; + my ($w, $h) = $self->size_request;#TODO# use widht/height of texture my $tex = $self->{texture} or return; @@ -169,10 +162,10 @@ glColor 1, 1, 1; glBegin GL_QUADS; - glTexCoord 0, 0; glVertex 0 , 0; - glTexCoord 0, 1; glVertex 0 , $h; - glTexCoord 1, 1; glVertex $w , $h; - glTexCoord 1, 0; glVertex $w , 0; + glTexCoord 0, 0; glVertex 0, 0; + glTexCoord 0, 1; glVertex 0, $h; + glTexCoord 1, 1; glVertex $w, $h; + glTexCoord 1, 0; glVertex $w, 0; glEnd; glDisable GL_BLEND; @@ -209,7 +202,7 @@ glPushMatrix; glTranslate (2, 2, 0); - $chld->_draw; + $chld->draw; glPopMatrix; } @@ -282,9 +275,9 @@ for (my $xi = 0; $xi <= $#{$self->{childs}->[$yi]}; $xi++) { glPushMatrix; - glTranslate ($x, $y, 0); + glTranslate ($x, $y, 0);#TODO#there must be no translate here, instead the widget must be moved my $c = $self->{childs}->[$yi]->[$xi]; - $c->_draw if $c; + $c->draw if $c; glPopMatrix; $x += $self->max_col_width ($xi); @@ -324,8 +317,8 @@ my ($x, $y); for (@{$self->{childs} || []}) { glPushMatrix; - glTranslate (0, $y, 0); - $_->_draw; + glTranslate (0, $y, 0);# see above TODO + $_->draw; glPopMatrix; my ($w, $h) = $_->size_request; $y += $h;