GL.pm (PDL-2.082) | : | GL.pm (PDL-2.083) | ||
---|---|---|---|---|
skipping to change at line 530 | skipping to change at line 530 | |||
GLX_BLUE_SIZE,1, | GLX_BLUE_SIZE,1, | |||
GLX_DEPTH_SIZE,1, | GLX_DEPTH_SIZE,1, | |||
# Alpha size? | # Alpha size? | |||
] unless defined $options->{attributes}; | ] unless defined $options->{attributes}; | |||
$options->{mask} = (KeyPressMask | ButtonPressMask | | $options->{mask} = (KeyPressMask | ButtonPressMask | | |||
ButtonMotionMask | ButtonReleaseMask | | ButtonMotionMask | ButtonReleaseMask | | |||
ExposureMask | StructureNotifyMask | | ExposureMask | StructureNotifyMask | | |||
PointerMotionMask) unless defined $options->{mask}; | PointerMotionMask) unless defined $options->{mask}; | |||
print "STARTING OPENGL $options->{width} $options->{height}\n" if($PDL::Graphi cs::TriD::verbose); | print "STARTING OPENGL $options->{width} $options->{height}\n" if($PDL::Graphi cs::TriD::verbose); | |||
print "gdriver: Calling OpengGL::OO($options)...\n" if ($PDL::Graphics::TriD:: verbose); | print "gdriver: Calling OpengGL::OO($options)...\n" if ($PDL::Graphics::TriD:: verbose); | |||
$this->{_GLObject}= new PDL::Graphics::OpenGL::OO($options); | $this->{_GLObject}= PDL::Graphics::OpenGL::OO->new($options); | |||
if (exists $this->{_GLObject}->{glutwindow}) { | if (exists $this->{_GLObject}->{glutwindow}) { | |||
if ($PDL::Graphics::TriD::verbose) { | if ($PDL::Graphics::TriD::verbose) { | |||
print "gdriver: Got OpenGL::OO object(GLUT window ID# " . $this->{_GLObj ect}->{glutwindow} . ")\n"; | print "gdriver: Got OpenGL::OO object(GLUT window ID# " . $this->{_GLObj ect}->{glutwindow} . ")\n"; | |||
} | } | |||
$this->{_GLObject}->{winobjects}->[$this->{_GLObject}->{glutwindow}] = $thi s; # circular ref | $this->{_GLObject}->{winobjects}->[$this->{_GLObject}->{glutwindow}] = $thi s; # circular ref | |||
} | } | |||
print "gdriver: Calling glClearColor...\n" if $PDL::Graphics::TriD::verbose; | print "gdriver: Calling glClearColor...\n" if $PDL::Graphics::TriD::verbose; | |||
glClearColor(0,0,0,1); | glClearColor(0,0,0,1); | |||
print "gdriver: Calling glpRasterFont...\n" if $PDL::Graphics::TriD::verbose; | print "gdriver: Calling glpRasterFont...\n" if $PDL::Graphics::TriD::verbose; | |||
$PDL::Graphics::TriD::GL::fontbase = $this->{_GLObject}->glpRasterFont($ENV{PD L_3D_FONT} || "5x8", 0, 256); | $PDL::Graphics::TriD::GL::fontbase = $this->{_GLObject}->glpRasterFont($ENV{PD L_3D_FONT} || "5x8", 0, 256); | |||
skipping to change at line 794 | skipping to change at line 794 | |||
use fields qw/X0 Y0 W H Transformer EHandler Active ResizeCommands | use fields qw/X0 Y0 W H Transformer EHandler Active ResizeCommands | |||
DefMaterial AspectRatio Graphs/; | DefMaterial AspectRatio Graphs/; | |||
use OpenGL qw/ :glfunctions :glconstants :glufunctions /; | use OpenGL qw/ :glfunctions :glconstants :glufunctions /; | |||
use OpenGL::GLUT qw( :all ); | use OpenGL::GLUT qw( :all ); | |||
use PDL::Graphics::OpenGL::Perl::OpenGL; | use PDL::Graphics::OpenGL::Perl::OpenGL; | |||
use PDL::Graphics::OpenGLQ; | use PDL::Graphics::OpenGLQ; | |||
sub highlight { | sub highlight { | |||
my ($vp) = @_; | my ($vp) = @_; | |||
my $pts = new PDL [[0,0,0], | my $pts = PDL->new([[0,0,0], | |||
[$vp->{W},0,0], | [$vp->{W},0,0], | |||
[$vp->{W},$vp->{H},0], | [$vp->{W},$vp->{H},0], | |||
[0,$vp->{H},0], | [0,$vp->{H},0], | |||
[0,0,0]]; | [0,0,0]]); | |||
glDisable(GL_LIGHTING); | glDisable(GL_LIGHTING); | |||
glMatrixMode(GL_MODELVIEW); | glMatrixMode(GL_MODELVIEW); | |||
glLoadIdentity(); | glLoadIdentity(); | |||
glMatrixMode(GL_PROJECTION); | glMatrixMode(GL_PROJECTION); | |||
glLoadIdentity(); | glLoadIdentity(); | |||
gluOrtho2D(0,$vp->{W},0,$vp->{H}); | gluOrtho2D(0,$vp->{W},0,$vp->{H}); | |||
glLineWidth(4); | glLineWidth(4); | |||
glColor3f(1,1,1); | glColor3f(1,1,1); | |||
gl_line_strip_nc($pts); | gl_line_strip_nc($pts); | |||
glLineWidth(1); | glLineWidth(1); | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |