diff options
author | Kenneth Russel <[email protected]> | 2001-06-27 04:55:41 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2001-06-27 04:55:41 +0000 |
commit | 61e02f1715c8752c74b89a903ce5507215c857b6 (patch) | |
tree | d603f2ce7d07bb0fee9856b855bac58335c11e69 /gl4java/awt | |
parent | 61718067af10833ee7b1c3f0fb6b9d6acf1814fe (diff) |
*** empty log message ***
Diffstat (limited to 'gl4java/awt')
-rw-r--r-- | gl4java/awt/GLCanvas.java | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/gl4java/awt/GLCanvas.java b/gl4java/awt/GLCanvas.java index 0b89bf8..a7ade2a 100644 --- a/gl4java/awt/GLCanvas.java +++ b/gl4java/awt/GLCanvas.java @@ -449,11 +449,15 @@ public class GLCanvas extends Canvas context handling by calling {@link #setAWTThreadRenderingEnabled} and {@link #setAutoMakeContextCurrent} with the given boolean. */ - public void optimizeContextHandling(boolean yesOrNo) { + public void setOptimizeContextHandling(boolean yesOrNo) { setAWTThreadRenderingEnabled(yesOrNo); setAutoMakeContextCurrent(yesOrNo); } + public boolean getOptimizeContextHandling() { + return getAWTThreadRenderingEnabled() || getAutoMakeContextCurrent(); + } + /** * this function overrides the Canvas paint method ! * @@ -804,18 +808,7 @@ public class GLCanvas extends Canvas if( mustResize ) { - if (getAutoMakeContextCurrent() && getAWTThreadRenderingEnabled()) { - if( glj.gljMakeCurrent() == true ) - { - size = getSize(); - glj.gljResize( size.width, size.height ) ; - reshape(size.width, size.height); - mustResize = false; - invalidate(); - repaint(100); - glj.gljFree(); - } - } else if (getAutoMakeContextCurrent()) { + if (getAutoMakeContextCurrent()) { if( glj.gljMakeCurrent() == true ) { size = getSize(); @@ -826,17 +819,17 @@ public class GLCanvas extends Canvas repaint(100); glj.gljFree(); } - } else if (getAWTThreadRenderingEnabled()) { - size = getSize(); - glj.gljResize( size.width, size.height ) ; - reshape(size.width, size.height); - mustResize = false; - invalidate(); - repaint(100); } else { size = getSize(); glj.gljResize( size.width, size.height ) ; + if (getAWTThreadRenderingEnabled()) { + reshape(size.width, size.height); + } mustResize = false; + if (getAWTThreadRenderingEnabled()) { + invalidate(); + repaint(100); + } } } |