aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2003-07-15 22:32:05 +0000
committerKenneth Russel <[email protected]>2003-07-15 22:32:05 +0000
commite4c41409b1b9e108f80de50a1c2cc9830377c53c (patch)
tree9a7bc991c9f726c29eb5dca90fb4753b221990e0
parentd1da6a87aa6c6cd5a697b2930a5af4ba0a650faf (diff)
Fixed bug in Animator where it would hang upon stopping if exception
was thrown during init(). Fixed build.xml files to get javac to produce source file and line number information. Fixed demos to pop up a dialog box if an extension they need is unsupported. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@35 232f8b59-042b-4e1e-8c03-345bb8c30851
-rw-r--r--make/build-gluegen.xml4
-rw-r--r--make/build-staticglgen.xml4
-rw-r--r--make/build.xml4
-rw-r--r--src/net/java/games/jogl/Animator.java50
4 files changed, 33 insertions, 29 deletions
diff --git a/make/build-gluegen.xml b/make/build-gluegen.xml
index f0236811b..a12f668ab 100644
--- a/make/build-gluegen.xml
+++ b/make/build-gluegen.xml
@@ -75,7 +75,7 @@
- NOTE: GlueGenTask is NOT built at this time. It is done in
- a separate task. -->
<javac destdir="${classes}" includes="**/gluegen/**" excludes="**/GlueGenTask.java"
- source="1.4">
+ source="1.4" debug="true" debuglevel="source,lines">
<src path="${src}" />
<src path="${src.generated.java}" />
<classpath refid="antlr.classpath" />
@@ -135,7 +135,7 @@
<!-- Build the GlueGen ANT task.
- NOTE: ONLY the GlueGenTask is built at this time. GlueGen
- itself is built in a separate task. -->
- <javac destdir="${classes}" includes="**/GlueGenTask.java" source="1.4">
+ <javac destdir="${classes}" includes="**/GlueGenTask.java" source="1.4" debug="true" debuglevel="source,lines">
<src path="${src}" />
<classpath refid="antlr.classpath" />
</javac>
diff --git a/make/build-staticglgen.xml b/make/build-staticglgen.xml
index d054abbb0..0f72bcfa7 100644
--- a/make/build-staticglgen.xml
+++ b/make/build-staticglgen.xml
@@ -29,7 +29,7 @@
<mkdir dir="${classes}" />
<!-- Compile BuildStaticGLInfo -->
- <javac srcdir="${src}" destdir="${classes}" includes="**/BuildStaticGLInfo.java" source="1.4">
+ <javac srcdir="${src}" destdir="${classes}" includes="**/BuildStaticGLInfo.java" source="1.4" debug="true" debuglevel="source,lines">
<classpath refid="antlr.classpath" />
</javac>
@@ -49,7 +49,7 @@
<!-- Build the BuildStaticGLInfo ANT task.
- NOTE: ONLY the StaticGLGen is built at this time. BuildStaticGLInfo
- itself is built in a separate task. -->
- <javac destdir="${classes}" includes="**/StaticGLGenTask.java" source="1.4">
+ <javac destdir="${classes}" includes="**/StaticGLGenTask.java" source="1.4" debug="true" debuglevel="source,lines">
<src path="${src}" />
<classpath refid="classpath" />
</javac>
diff --git a/make/build.xml b/make/build.xml
index 37ab9dbec..0118fbbb5 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -678,7 +678,7 @@
</java>
<!-- Perform the second pass Java compile which compiles the composable pipelines. -->
- <javac destdir="${classes}" includes="${src.generated.java.pipeline}" source="1.4">
+ <javac destdir="${classes}" includes="${src.generated.java.pipeline}" source="1.4" debug="true" debuglevel="source,lines">
<src path="${src}" />
<src path="${src.generated.java}" />
<classpath refid="antlr.classpath" />
@@ -694,7 +694,7 @@
<target name="java.compile" depends="java.generate,java.generate.cg">
<!-- Perform the first pass Java compile. -->
<javac destdir="${classes}"
- excludes="${java.excludes.platform}" source="1.4">
+ excludes="${java.excludes.platform}" source="1.4" debug="true" debuglevel="source,lines">
<src path="${src}" />
<src path="${src.generated.java}" />
<classpath refid="antlr.classpath" />
diff --git a/src/net/java/games/jogl/Animator.java b/src/net/java/games/jogl/Animator.java
index d21d483e1..5ab2aad75 100644
--- a/src/net/java/games/jogl/Animator.java
+++ b/src/net/java/games/jogl/Animator.java
@@ -80,25 +80,25 @@ public class Animator {
if (runnable == null) {
runnable = new Runnable() {
public void run() {
- // Try to get OpenGL context optimization since we know we
- // will be rendering this one drawable continually from
- // this thread; make the context current once instead of
- // making it current and freeing it each frame.
- drawable.setRenderingThread(Thread.currentThread());
-
- // Since setRenderingThread is currently advisory (because
- // of the poor JAWT implementation in the Motif AWT, which
- // performs excessive locking) we also prevent repaint(),
- // which is called from the AWT thread, from having an
- // effect for better multithreading behavior. This call is
- // not strictly necessary, but if end users write their
- // own animation loops which update multiple drawables per
- // tick then it may be necessary to enforce the order of
- // updates.
- drawable.setNoAutoRedrawMode(true);
-
boolean noException = false;
try {
+ // Try to get OpenGL context optimization since we know we
+ // will be rendering this one drawable continually from
+ // this thread; make the context current once instead of
+ // making it current and freeing it each frame.
+ drawable.setRenderingThread(Thread.currentThread());
+
+ // Since setRenderingThread is currently advisory (because
+ // of the poor JAWT implementation in the Motif AWT, which
+ // performs excessive locking) we also prevent repaint(),
+ // which is called from the AWT thread, from having an
+ // effect for better multithreading behavior. This call is
+ // not strictly necessary, but if end users write their
+ // own animation loops which update multiple drawables per
+ // tick then it may be necessary to enforce the order of
+ // updates.
+ drawable.setNoAutoRedrawMode(true);
+
while (!shouldStop) {
noException = false;
drawable.display();
@@ -107,14 +107,18 @@ public class Animator {
} finally {
shouldStop = false;
drawable.setNoAutoRedrawMode(false);
- if (noException) {
- try {
+ try {
+ // The surface is already unlocked and rendering
+ // thread is already null if an exception occurred
+ // during display(), so don't disable the rendering
+ // thread again.
+ if (noException) {
drawable.setRenderingThread(null);
- } finally {
+ }
+ } finally {
+ synchronized (Animator.this) {
thread = null;
- synchronized (Animator.this) {
- Animator.this.notify();
- }
+ Animator.this.notify();
}
}
}