summaryrefslogtreecommitdiffstats
path: root/src/demos/testContextSharing
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/testContextSharing')
-rw-r--r--src/demos/testContextSharing/TestContextSharing.java7
1 files changed, 6 insertions, 1 deletions
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();