diff options
author | Sven Gothel <[email protected]> | 2001-07-26 02:57:55 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2001-07-26 02:57:55 +0000 |
commit | 26883064d71736ccd96a6f1d9b19b85b66f5ac7c (patch) | |
tree | aab31ca2314fe2d0fb9296e19003b99afc1f0ebd /gl4java | |
parent | 3583101e586a6fe3306f84d4d34ee764596e0632 (diff) |
fixed cvsIsInit
Diffstat (limited to 'gl4java')
-rw-r--r-- | gl4java/awt/GLCanvas.java | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/gl4java/awt/GLCanvas.java b/gl4java/awt/GLCanvas.java index 041fabb..e54505f 100644 --- a/gl4java/awt/GLCanvas.java +++ b/gl4java/awt/GLCanvas.java @@ -90,6 +90,7 @@ public class GLCanvas extends Canvas protected Dimension size = null; protected boolean mustResize = false; + protected boolean isInit = false; protected boolean needCvsDispose = false; @@ -433,15 +434,14 @@ public class GLCanvas extends Canvas sharedGLContext ); } - if(glj!=null) - { - createOwnWindow = glj.isOwnWindowCreated(); - doubleBuffer = glj.isDoubleBuffer(); - stencilBits = glj.getStencilBitNumber(); - accumSize = glj.getAccumSize(); - stereoView = glj.isStereoView(); - rgba = glj.isRGBA(); - } + if(glj==null) return; + + createOwnWindow = glj.isOwnWindowCreated(); + doubleBuffer = glj.isDoubleBuffer(); + stencilBits = glj.getStencilBitNumber(); + accumSize = glj.getAccumSize(); + stereoView = glj.isStereoView(); + rgba = glj.isRGBA(); Color col = getBackground(); gl.glClearColor((float)col.getRed()/255.0f, @@ -484,6 +484,7 @@ public class GLCanvas extends Canvas /* force a reshape, to be sure .. */ mustResize = true; + isInit = true; } sDisplay(); @@ -559,9 +560,7 @@ public class GLCanvas extends Canvas */ public boolean cvsIsInit() { - if(glj!=null) - return glj.gljIsInit(); - return false; + return isInit && glj!=null && glj.gljIsInit(); } /** @@ -652,10 +651,7 @@ public class GLCanvas extends Canvas { boolean ok = true; - if(!cvsIsInit()) - { - return; - } + if(!cvsIsInit()) return; if( mustResize ) { @@ -930,6 +926,8 @@ public class GLCanvas extends Canvas System.out.println("GLCanvas cvsDispose (doit="+ ( (glj != null) && glj.gljIsInit() ) +")"); + isInit = false; + removeComponentListener(this); removeMouseListener(this); |