diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java | 14 | ||||
-rw-r--r-- | src/demos/tess/Tess.java | 7 | ||||
-rwxr-xr-x | src/demos/testContextDestruction/TestContextDestruction.java | 7 | ||||
-rw-r--r-- | src/demos/testContextSharing/TestContextSharing.java | 7 |
4 files changed, 30 insertions, 5 deletions
diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java index f8a01aa..049bd3d 100644 --- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java +++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java @@ -161,7 +161,12 @@ public class HWShadowmapsSimple { class Listener implements GLEventListener { public void init(GLDrawable drawable) { - // drawable.setGL(new DebugGL(drawable.getGL())); + // init() might get called more than once if the GLCanvas is + // added and removed, but we only want to install the DebugGL + // pipeline once + // if (!(drawable.getGL() instanceof DebugGL)) { + // drawable.setGL(new DebugGL(drawable.getGL())); + // } GL gl = drawable.getGL(); GLU glu = drawable.getGLU(); @@ -376,7 +381,12 @@ public class HWShadowmapsSimple { class PbufferListener implements GLEventListener { public void init(GLDrawable drawable) { - // drawable.setGL(new DebugGL(drawable.getGL())); + // init() might get called more than once if the GLCanvas is + // added and removed, but we only want to install the DebugGL + // pipeline once + // if (!(drawable.getGL() instanceof DebugGL)) { + // drawable.setGL(new DebugGL(drawable.getGL())); + // } GL gl = drawable.getGL(); GLU glu = drawable.getGLU(); diff --git a/src/demos/tess/Tess.java b/src/demos/tess/Tess.java index 4063367..354a0c9 100644 --- a/src/demos/tess/Tess.java +++ b/src/demos/tess/Tess.java @@ -103,7 +103,12 @@ public class Tess { public void init(GLDrawable drawable) { gl = drawable.getGL(); glu = drawable.getGLU(); - drawable.setGL(new DebugGL(drawable.getGL())); + // init() might get called more than once if the GLCanvas is + // added and removed, but we only want to install the DebugGL + // pipeline once + if (!(drawable.getGL() instanceof DebugGL)) { + drawable.setGL(new DebugGL(drawable.getGL())); + } double[][] rect = new double[][]{{50.0, 50.0, 0.0}, {200.0, 50.0, 0.0}, diff --git a/src/demos/testContextDestruction/TestContextDestruction.java b/src/demos/testContextDestruction/TestContextDestruction.java index 3adb73c..2edff00 100755 --- a/src/demos/testContextDestruction/TestContextDestruction.java +++ b/src/demos/testContextDestruction/TestContextDestruction.java @@ -178,7 +178,12 @@ public class TestContextDestruction { class Listener implements GLEventListener { public void init(GLDrawable drawable) { System.out.println("Listener.init()"); - drawable.setGL(new DebugGL(drawable.getGL())); + // init() might get called more than once if the GLCanvas is + // added and removed, but we only want to install the DebugGL + // pipeline once + if (!(drawable.getGL() instanceof DebugGL)) { + drawable.setGL(new DebugGL(drawable.getGL())); + } GL gl = drawable.getGL(); diff --git a/src/demos/testContextSharing/TestContextSharing.java b/src/demos/testContextSharing/TestContextSharing.java index 88f453a..e50c4d0 100644 --- a/src/demos/testContextSharing/TestContextSharing.java +++ b/src/demos/testContextSharing/TestContextSharing.java @@ -97,7 +97,12 @@ public class TestContextSharing { class Listener implements GLEventListener { public void init(GLDrawable drawable) { - drawable.setGL(new DebugGL(drawable.getGL())); + // init() might get called more than once if the GLCanvas is + // added and removed, but we only want to install the DebugGL + // pipeline once + if (!(drawable.getGL() instanceof DebugGL)) { + drawable.setGL(new DebugGL(drawable.getGL())); + } GL gl = drawable.getGL(); |