Skip to content

Commit 84f6d50

Browse files
committed
incorporate glOptions into only call-site
1 parent a70bd7f commit 84f6d50

File tree

1 file changed

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

1 file changed

+7
-12
lines changed

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ sub PDL::Graphics::TriD::GObject::togl {
142142
my ($this, $points) = @_;
143143
print "togl $this\n" if $PDL::Graphics::TriD::verbose;
144144
glPushAttrib(GL_LIGHTING_BIT | GL_ENABLE_BIT);
145-
$this->glOptions;
145+
glLineWidth($this->{Options}{LineWidth} || 1);
146+
glPointSize($this->{Options}{PointSize} || 1);
147+
glEnable(GL_DEPTH_TEST);
148+
$this->{Options}{Lighting} ? glEnable(GL_LIGHTING) : glDisable(GL_LIGHTING);
149+
glEnable(GL_LIGHT0);
150+
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
151+
glLightfv_s(GL_LIGHT0,GL_POSITION,pack "f*",1.0,1.0,1.0,0.0);
146152
eval {
147153
$this->gdraw($points // $this->{Points});
148154
};
@@ -179,17 +185,6 @@ sub PDL::Graphics::TriD::Lines::gdraw {
179185
PDL::gl_lines_col($points,$this->{Colors});
180186
}
181187

182-
sub PDL::Graphics::TriD::GObject::glOptions {
183-
my ($this) = @_;
184-
glLineWidth($this->{Options}{LineWidth} || 1);
185-
glPointSize($this->{Options}{PointSize} || 1);
186-
glEnable(GL_DEPTH_TEST);
187-
$this->{Options}{Lighting} ? glEnable(GL_LIGHTING) : glDisable(GL_LIGHTING);
188-
glEnable(GL_LIGHT0);
189-
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
190-
glLightfv_s(GL_LIGHT0,GL_POSITION,pack "f*",1.0,1.0,1.0,0.0);
191-
}
192-
193188
sub PDL::Graphics::TriD::GObject::_lattice_lines {
194189
my ($this, $points) = @_;
195190
glDisable(GL_LIGHTING);

0 commit comments

Comments
 (0)