diff options
Diffstat (limited to 'src/net/java/joglutils/model/examples')
-rw-r--r-- | src/net/java/joglutils/model/examples/DisplayListRenderer.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/net/java/joglutils/model/examples/DisplayListRenderer.java b/src/net/java/joglutils/model/examples/DisplayListRenderer.java index f297c24..50f7d99 100644 --- a/src/net/java/joglutils/model/examples/DisplayListRenderer.java +++ b/src/net/java/joglutils/model/examples/DisplayListRenderer.java @@ -82,9 +82,12 @@ public class DisplayListRenderer implements iModel3DRenderer { // save some current state variables
boolean isTextureEnabled = gl.glIsEnabled(GL.GL_TEXTURE_2D);
- boolean isLightingEnabled = gl.glIsEnabled(GL.GL_LIGHTING);
+ boolean isLightingEnabled = gl.glIsEnabled(GL.GL_LIGHTING);
boolean isMaterialEnabled = gl.glIsEnabled(GL.GL_COLOR_MATERIAL);
+ // check lighting
+ if (!model.isUsingLighting()) { gl.glDisable(GL.GL_LIGHTING); }
+
// check texture
if (model.isUsingTexture()) { gl.glEnable(GL.GL_TEXTURE_2D); }
else { gl.glDisable(GL.GL_TEXTURE_2D); }
@@ -93,10 +96,6 @@ public class DisplayListRenderer implements iModel3DRenderer { if (model.isRenderingAsWireframe()) { gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE); }
else { gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_FILL); }
- // check lighting
- if (model.isUsingLighting()) { gl.glEnable(GL.GL_LIGHTING); }
- else { gl.glDisable(GL.GL_LIGHTING); }
-
gl.glDisable(GL.GL_COLOR_MATERIAL);
gl.glPushMatrix();
|