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.32 by elmex, Sun Apr 9 01:21:11 2006 UTC vs.
Revision 1.33 by root, Sun Apr 9 01:37:58 2006 UTC

425use SDL::OpenGL; 425use SDL::OpenGL;
426 426
427sub new { 427sub new {
428 my ($class, $x, $y, $z, $height, $text) = @_; 428 my ($class, $x, $y, $z, $height, $text) = @_;
429 429
430 # TODO: color, and make height, xyz etc. optional
430 my $self = $class->SUPER::new (x => $x, y => $y, z => $z, height => $height); 431 my $self = $class->SUPER::new (x => $x, y => $y, z => $z, height => $height);
431 432
432 $self->set_text ($text); 433 $self->set_text ($text);
433 434
434 $self 435 $self
467 glEnable GL_TEXTURE_2D; 468 glEnable GL_TEXTURE_2D;
468 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 469 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
469 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 470 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
470 glBindTexture GL_TEXTURE_2D, $tex->{name}; 471 glBindTexture GL_TEXTURE_2D, $tex->{name};
471 472
472 glColor 1, 1, 1, 0.8; 473 glColor 1, 1, 1, 0.6; # TODO color
473 474
474 glBegin GL_QUADS; 475 glBegin GL_QUADS;
475 glTexCoord 0, 0; glVertex 0 , 0; 476 glTexCoord 0, 0; glVertex 0 , 0;
476 glTexCoord 0, 1; glVertex 0 , $tex->{height}; 477 glTexCoord 0, 1; glVertex 0 , $tex->{height};
477 glTexCoord 1, 1; glVertex $tex->{width}, $tex->{height}; 478 glTexCoord 1, 1; glVertex $tex->{width}, $tex->{height};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines