summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrodgersgb <[email protected]>2008-05-07 18:22:03 +0000
committerrodgersgb <[email protected]>2008-05-07 18:22:03 +0000
commitb1196e004bdf8cb9c342e96313becb627e32f871 (patch)
treef5bdb17bf138718a3d8d2eb79f9a46faca4fa995
parent0ab9145d93503175f09d74cdcce67b9fe06a0086 (diff)
Updated the render method to correctly handle the lighting. There was a line of code that turned on lighting when it should not have.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@100 83d24430-9974-4f80-8418-2cc3294053b9
-rw-r--r--src/net/java/joglutils/model/examples/DisplayListRenderer.java9
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();