From f5c309d2cc4925ddaed6da36c542ef22a43a6552 Mon Sep 17 00:00:00 2001 From: Bill Kuker Date: Fri, 6 Jul 2012 18:40:43 +0000 Subject: [PATCH] Move lighting setup into RenderStrategies --- .../gui/figure3d/RocketFigure3d.java | 20 ------------------- .../gui/figure3d/RocketRenderer.java | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/core/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java b/core/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java index 6fd012f5a..b24e727ee 100644 --- a/core/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java +++ b/core/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java @@ -17,7 +17,6 @@ import java.util.Set; import javax.media.opengl.GL; import javax.media.opengl.GL2; -import javax.media.opengl.GL2ES1; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLEventListener; @@ -388,25 +387,6 @@ public class RocketFigure3d extends JPanel implements GLEventListener { gl.glDepthFunc(GL.GL_LEQUAL); // the type of depth test to do - gl.glLightModelfv(GL2ES1.GL_LIGHT_MODEL_AMBIENT, - new float[] { 0,0,0 }, 0); - - float amb = 0.3f; - float dif = 1.0f - amb; - float spc = 1.0f; - gl.glLightfv(GLLightingFunc.GL_LIGHT1, GLLightingFunc.GL_AMBIENT, - new float[] { amb, amb, amb, 1 }, 0); - gl.glLightfv(GLLightingFunc.GL_LIGHT1, GLLightingFunc.GL_DIFFUSE, - new float[] { dif, dif, dif, 1 }, 0); - gl.glLightfv(GLLightingFunc.GL_LIGHT1, GLLightingFunc.GL_SPECULAR, - new float[] { spc, spc, spc, 1 }, 0); - - gl.glEnable(GLLightingFunc.GL_LIGHT1); - gl.glEnable(GLLightingFunc.GL_LIGHTING); - gl.glShadeModel(GLLightingFunc.GL_SMOOTH); - - gl.glEnable(GLLightingFunc.GL_NORMALIZE); - extrasOverlay = new Overlay(drawable); caretOverlay = new Overlay(drawable); diff --git a/core/src/net/sf/openrocket/gui/figure3d/RocketRenderer.java b/core/src/net/sf/openrocket/gui/figure3d/RocketRenderer.java index 46c73a92f..7f62c8f84 100644 --- a/core/src/net/sf/openrocket/gui/figure3d/RocketRenderer.java +++ b/core/src/net/sf/openrocket/gui/figure3d/RocketRenderer.java @@ -27,7 +27,7 @@ public class RocketRenderer { @SuppressWarnings("unused") private static final LogHelper log = Application.getLogger(); - RenderStrategy currentStrategy = new RealisticRenderStrategy(); + RenderStrategy currentStrategy = new FigureRenderStrategy(); ComponentRenderer cr;