From b1196e004bdf8cb9c342e96313becb627e32f871 Mon Sep 17 00:00:00 2001 From: rodgersgb Date: Wed, 7 May 2008 18:22:03 +0000 Subject: 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 --- src/net/java/joglutils/model/examples/DisplayListRenderer.java | 9 ++++----- 1 file 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(); -- cgit v1.2.3