diff options
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java index 776f27c1f..133c3866f 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java +++ b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java @@ -378,8 +378,15 @@ public abstract class TileRendererBase { final GLEventListener l = glad.getGLEventListener(0); listenersInit[i] = glad.getGLEventListenerInitState(l); listeners[i] = glad.removeGLEventListener( l ); + final boolean trn; if( listeners[i] instanceof TileRendererNotify ) { + trn = true; ((TileRendererNotify)listeners[i]).addTileRendererNotify(this); + } else { + trn = false; + } + if( DEBUG ) { + System.err.println("TileRenderer.attach["+i+"]: isInit "+listenersInit[i]+", isTRN "+trn+", "+listeners[i].getClass().getName()); } } glad.addGLEventListener(tiledGLEL); @@ -461,8 +468,10 @@ public abstract class TileRendererBase { final int aSz = listenersInit.length; for(int i=0; i<aSz; i++) { final GLEventListener l = listeners[i]; - l.init(drawable); - listenersInit[i] = true; + if( !listenersInit[i] ) { + l.init(drawable); + listenersInit[i] = true; + } } if( null != glEventListenerPost ) { glEventListenerPost.init(drawable); |