summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();
}
}
}