summaryrefslogtreecommitdiffstats
path: root/src/demos/applets/JOGLNewtAppletBase.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-10-10 07:22:31 -0700
committerSven Gothel <[email protected]>2009-10-10 07:22:31 -0700
commitf21921ffbee502483b87b0f7eb03c0af299cb24b (patch)
tree265abd9c59e65b32bee5920b96c22bae3804cbe9 /src/demos/applets/JOGLNewtAppletBase.java
parent983ed55be2d69de57e52a106ea8809b52730ad12 (diff)
JOGL changes ..
Diffstat (limited to 'src/demos/applets/JOGLNewtAppletBase.java')
-rwxr-xr-xsrc/demos/applets/JOGLNewtAppletBase.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/demos/applets/JOGLNewtAppletBase.java b/src/demos/applets/JOGLNewtAppletBase.java
index 54dcf8f..12d2af7 100755
--- a/src/demos/applets/JOGLNewtAppletBase.java
+++ b/src/demos/applets/JOGLNewtAppletBase.java
@@ -16,7 +16,6 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
String glEventListenerClazzName;
int glSwapInterval;
boolean handleWindowEvents;
- boolean useGLInEventHandler;
boolean glDebug;
boolean glTrace;
@@ -28,14 +27,12 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
public JOGLNewtAppletBase(String glEventListenerClazzName,
int glSwapInterval,
boolean handleWindowEvents,
- boolean useGLInEventHandler,
boolean glDebug,
boolean glTrace) {
this.glEventListenerClazzName=glEventListenerClazzName;
this.glSwapInterval=glSwapInterval;
this.handleWindowEvents=handleWindowEvents;
- this.useGLInEventHandler=useGLInEventHandler;
this.glDebug = glDebug;
this.glTrace = glTrace;
}
@@ -98,6 +95,10 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
}
public void init(Window nWindow) {
+ init(Thread.currentThread().getThreadGroup(), nWindow);
+ }
+
+ public void init(ThreadGroup tg, Window nWindow) {
glEventListener = createInstance(glEventListenerClazzName);
try {
@@ -125,13 +126,11 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
}
glWindow.addKeyListener(this);
- glWindow.setEventHandlerMode( useGLInEventHandler ? GLWindow.EVENT_HANDLER_GL_CURRENT : GLWindow.EVENT_HANDLER_GL_NONE );
glWindow.setRunPumpMessages(handleWindowEvents);
- glWindow.setVisible(true);
glWindow.enablePerfLog(true);
// glAnimator = new FPSAnimator(canvas, 60);
- glAnimator = new Animator(glWindow);
+ glAnimator = new Animator(tg, glWindow);
} catch (Throwable t) {
throw new RuntimeException(t);
}
@@ -140,6 +139,7 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
public void start() {
if(isValid) {
+ glWindow.setVisible(true);
glAnimator.start();
}
}
@@ -147,6 +147,7 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
public void stop() {
if(null!=glAnimator) {
glAnimator.stop();
+ glWindow.setVisible(false);
}
}
@@ -158,7 +159,7 @@ public class JOGLNewtAppletBase implements WindowListener, KeyListener, MouseLis
glAnimator=null;
}
if(null!=glWindow) {
- glWindow.destroy();
+ glWindow.destroy(true); // deep, incl. Screen and Display
glWindow=null;
}
}