--- deliantra/Deliantra-Client/DC.pm 2006/04/08 13:36:25 1.8 +++ deliantra/Deliantra-Client/DC.pm 2006/04/08 18:48:34 1.12 @@ -55,6 +55,7 @@ or return; { + require Data::Dumper; local $Data::Dumper::Purity = 1; $::CFG->{VERSION} = $::VERSION; print CFG Data::Dumper->Dump ([$::CFG], [qw/CFG/]); @@ -126,7 +127,7 @@ sub new_from_opengl { my ($class, $w, $h, $cb) = @_; - $class->_new (width => $w, height => $h, render => $cb) + $class->_new (width => $w, height => $h, rendercb => $cb) } sub upload { @@ -140,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}, $self->{height}, 0, -100, 100; + glMatrixMode GL_MODELVIEW; + glPushmatrix; + glLoadIdentity; glClear GL_COLOR_BUFFER_BIT; $self->{rendercb}->($self, $self->{width}, $self->{height}); @@ -175,11 +182,19 @@ 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"; + sleep 1; } }