aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2013-09-28 01:52:39 +0200
committerSven Gothel <sgothel@jausoft.com>2013-09-28 01:52:39 +0200
commitc8abb9d2c9a8c92f0c5c42aba13e3e80c69739dc (patch)
tree7997091175868b945f714094fb62cd09a08552bb /src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
parentc943c8cfc39df64ec6682722e86a54c538d3497b (diff)
TileRendererBase.GLEL.display(): Skip tile-rendering if TR is not yet setup. Sync issue w/ NEWT/AWT based GLAD
NEWT based GLDrawables may trigger GLAD display() via native repaint events. If using in conjunction w/ AWT, i.e. NewtCanvasAWT and setupPrinting(..) has been called and it's attched to the TR .. it could happen that display tries to issue beginTile() before the TR is being setup. This patch mitigates this issue (while not removing it) by querying whether setup is completed.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
index 5b3644f59..f00e59347 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
@@ -313,6 +313,13 @@ public abstract class TileRendererBase {
}
}
+ /**
+ * Returns true if this instance is setup properly, i.e. {@link #setImageSize(int, int)} ..,
+ * and ready for {@link #beginTile(GL)}.
+ * Otherwise returns false.
+ */
+ public abstract boolean isSetup();
+
/**
* Begins rendering a tile.
* <p>
@@ -577,6 +584,12 @@ public abstract class TileRendererBase {
}
@Override
public void display(GLAutoDrawable drawable) {
+ if( !isSetup() ) {
+ if( DEBUG ) {
+ System.err.println("TileRenderer.glel.display: !setup: "+TileRendererBase.this);
+ }
+ return;
+ }
if( null != glEventListenerPre ) {
glEventListenerPre.reshape(drawable, 0, 0, currentTileWidth, currentTileHeight);
glEventListenerPre.display(drawable);