--- deliantra/Deliantra-Client/DC.pm 2006/04/08 17:21:01 1.10 +++ deliantra/Deliantra-Client/DC.pm 2006/04/08 22:23:57 1.13 @@ -119,7 +119,7 @@ utf8::encode $text; my $surface = SDL::TTFRenderUTF8Blended $ttf, $text, - (new SDL::Color -r => 255, -g => 255, -b => 255); + (new SDL::Color -r => 0, -g => 0, -b => 0); $class->new_from_surface (bless \$surface, SDL::Surface::) } @@ -141,6 +141,12 @@ $data = $self->{data}; } elsif (exists $self->{rendercb}) { glViewport 0, 0, $self->{width}, $self->{height}; + glMatrixMode GL_PROJECTION; + glLoadIdentity; + glOrtho 0, $self->{width}, 0, $self->{height}, -100, 100; + glMatrixMode GL_MODELVIEW; + glPushmatrix; + glLoadIdentity; glClear GL_COLOR_BUFFER_BIT; $self->{rendercb}->($self, $self->{width}, $self->{height}); @@ -162,8 +168,8 @@ glBindTexture GL_TEXTURE_2D, $self->{name}; - glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR; - glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR;#_MIPMAP_LINEAR; + glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST; + glTexParameter GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST;#_MIPMAP_LINEAR; glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP; glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP; @@ -176,11 +182,20 @@ GL_UNSIGNED_BYTE, $data; } else { + warn "I{DTEDRAW TEX: $self->{width} $self->{height} \n"; + warn "ERR: ". (glGetError). "\n"; + my ($bd, $br) = (glGet (GL_DRAW_BUFFER), glGet (GL_READ_BUFFER)); + warn "BUF:[$bd $br]\n"; + glCopyTexImage2D GL_TEXTURE_2D, 0, GL_RGBA8, 0, 0, $self->{width}, $self->{height}, 0; + glPopmatrix; + warn "ERR: ". (glGetError). "\n"; + SDL::GLSwapBuffers; + sleep 1; } }