@@ -605,7 +605,7 @@ sub PDL::Graphics::TriD::SimpleController::togl {
605605 glTranslatef(map {-$_ } @{$this -> {WOrigin }});
606606}
607607
608- # #############################################
608+ {
609609# A window with mouse control over rotation.
610610package # hide from PAUSE
611611 PDL::Graphics::TriD::Window;
@@ -799,14 +799,11 @@ sub read_picture {
799799 glReadPixels_c(0,0,$w ,$h ,GL_RGB,GL_UNSIGNED_BYTE,$res -> make_physical-> address_data);
800800 return $res ;
801801}
802+ }
802803
803- # #####################################################################
804- # #####################################################################
805- # EVENT HANDLER MINIPACKAGE FOLLOWS!
806-
804+ {
807805package # hide from PAUSE
808806 PDL::Graphics::TriD::EventHandler;
809-
810807use fields qw/ X Y Buttons VP/ ;
811808sub new {
812809 my $class = shift ;
@@ -818,7 +815,6 @@ sub new {
818815 $self -> {VP } = $vp ;
819816 $self ;
820817}
821-
822818sub event {
823819 my ($this ,$type ,@args ) = @_ ;
824820 print " EH: " ,ref ($this )," $type (" ,join (" ," ,@args )," )\n " if $PDL::Graphics::TriD::verbose ;
@@ -850,28 +846,22 @@ sub event {
850846 }
851847 $retval ;
852848}
853-
854849sub set_button {
855850 my ($this ,$butno ,$act ) = @_ ;
856851 $this -> {Buttons }[$butno ] = $act ;
857852}
853+ }
858854
859- # #####################################################################
860- # #####################################################################
861- # VIEWPORT MINI_PACKAGE FOLLOWS!
862-
855+ {
863856package # hide from PAUSE
864857 PDL::Graphics::TriD::ViewPort;
865-
866858use OpenGL::Modern qw/
867859 glLoadIdentity glMatrixMode glOrtho glFrustum
868860 glViewport
869861 GL_MODELVIEW GL_PROJECTION
870862/ ;
871-
872863unshift @PDL::Graphics::TriD::GL::Highlight::ISA , qw( PDL::Graphics::TriD::Lines) ;
873864sub PDL ::Graphics::TriD::GL::Highlight::primitive {OpenGL::Modern::GL_LINE_LOOP}
874-
875865sub highlight {
876866 my ($vp ) = @_ ;
877867 if (!defined $vp -> {Impl }{highlight }) {
@@ -897,7 +887,6 @@ sub highlight {
897887 glOrtho(0,$vp -> {W },0,$vp -> {H },-1,1);
898888 $vp -> {Impl }{highlight }-> togl;
899889}
900-
901890use constant PI => 3.1415926535897932384626433832795;
902891use constant FOVY => 40.0;
903892use constant ANGLE => FOVY / 360 * PI;
@@ -920,6 +909,7 @@ sub do_perspective {
920909 glMatrixMode(GL_MODELVIEW);
921910 glLoadIdentity ();
922911}
912+ }
923913
924914package # hide from PAUSE
925915 PDL::Graphics::TriD::GL;
@@ -931,9 +921,6 @@ use PDL::Options;
931921
932922$PDL::Graphics::TriD::verbose //= 0;
933923
934- # This is a list of all the fields of the opengl object
935- # use fields qw/Display Window Context Options GL_Vendor GL_Version GL_Renderer/;
936-
937924=head1 NAME
938925
939926PDL::Graphics::TriD::GL - PDL TriD OpenGL interface using POGL
0 commit comments