Skip to content

Commit d06e1dc

Browse files
committed
remove custom ::Image::togl
1 parent f5327e9 commit d06e1dc

File tree

1 file changed

+7
-14
lines changed
  • lib/PDL/Graphics/TriD

1 file changed

+7
-14
lines changed

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -322,28 +322,21 @@ sub PDL::Graphics::TriD::STrigrid::gdraw {
322322
}
323323
}
324324

325-
##################################
326-
# PDL::Graphics::TriD::Image
327-
328-
sub PDL::Graphics::TriD::Image::togl {
329325
# A special construct which always faces the display and takes the entire window
330-
if ($_[0]{Options}{FullScreen}) {
331-
glMatrixMode(GL_MODELVIEW);
332-
glLoadIdentity();
333-
glMatrixMode(GL_PROJECTION);
334-
glLoadIdentity();
335-
glOrtho(0,1,0,1,-1,1);
336-
}
337-
goto &PDL::Graphics::TriD::GObject::togl;
338-
}
339-
340326
# The quick method is to use texturing for the good effect.
341327
sub PDL::Graphics::TriD::Image::gdraw {
342328
my($this,$vert) = @_;
343329
my ($p,$xd,$yd,$txd,$tyd) = $this->flatten(1); # do binary alignment
344330
if(!defined $vert) {$vert = $this->{Points}}
345331
barf "Need 3,4 vert"
346332
if grep $_->dim(1) < 4 || $_->dim(0) != 3, $vert;
333+
if ($_[0]{Options}{FullScreen}) {
334+
glMatrixMode(GL_MODELVIEW);
335+
glLoadIdentity();
336+
glMatrixMode(GL_PROJECTION);
337+
glLoadIdentity();
338+
glOrtho(0,1,0,1,-1,1);
339+
}
347340
glColor3d(1,1,1);
348341
glTexImage2D_s(GL_TEXTURE_2D, 0, GL_RGB, $txd, $tyd, 0, GL_RGB, GL_FLOAT, $p->get_dataref());
349342
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );

0 commit comments

Comments
 (0)