summaryrefslogtreecommitdiffstats
path: root/src/demos/testContextDestruction/TestContextDestruction.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-02-28 17:39:39 +0000
committerKenneth Russel <[email protected]>2005-02-28 17:39:39 +0000
commite9d9b9561c05ab8819ffff7c4b32ed9b1f8a2333 (patch)
tree95eb5b86ba01499752f2fab17ccaceb71fa19d0a /src/demos/testContextDestruction/TestContextDestruction.java
parent0c0451f6a5046e090a6c6dbde9426b1e12a259dc (diff)
Fixed bug in demos pointed out by chrisDUPUIS on javagaming.org forums
where we were creating multiple DebugGLs in particular in the TestContextDestruction demo, which was the cause of the slowdown in that demo git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@63 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/testContextDestruction/TestContextDestruction.java')
-rwxr-xr-xsrc/demos/testContextDestruction/TestContextDestruction.java7
1 files changed, 6 insertions, 1 deletions
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();