--- deliantra/Deliantra-Client/DC.pm 2006/04/09 00:12:58 1.15 +++ deliantra/Deliantra-Client/DC.pm 2006/04/10 11:55:16 1.18 @@ -126,7 +126,7 @@ width => $w, height => $h, data => $data, - internalformat => GL_ALPHA8, + internalformat => GL_ALPHA4, format => GL_ALPHA, ) } @@ -150,7 +150,7 @@ glViewport 0, 0, $self->{width}, $self->{height}; glMatrixMode GL_PROJECTION; glLoadIdentity; - glOrtho 0, $self->{width}, 0, $self->{height}, -100, 100; + glOrtho 0, $self->{width}, 0, $self->{height}, -10000, 10000; glMatrixMode GL_MODELVIEW; glPushmatrix; glLoadIdentity; @@ -180,6 +180,7 @@ glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP; glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP; + glGetError; if (defined $data) { glTexImage2D GL_TEXTURE_2D, 0, $self->{internalformat}, @@ -188,6 +189,7 @@ $self->{format}, GL_UNSIGNED_BYTE, $data; + glGetError and die; } else { glCopyTexImage2D GL_TEXTURE_2D, 0, $self->{internalformat}, @@ -195,8 +197,6 @@ $self->{width}, $self->{height}, 0; glPopmatrix; - #SDL::GLSwapBuffers; - #sleep 1; } } @@ -208,7 +208,7 @@ glDeleteTextures delete $self->{name}; } -push @::GLINIT, sub { +push @::GL_INIT, sub { $_->upload for grep $_, @textures; };