From 90e0e400f14e10cfba3aaa2d3760b95fc114ce65 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 24 Feb 2006 10:22:31 +0000 Subject: Fixed Issue 191: Add new opengl.1thread=new or similar A new recognized option -Dopengl.1thread=worker has been added to the Threading class and is now the default. Optimization has been added to leave the last context current on that thread so in the single-context case context switching is avoided. Code has been added to make this interoperate well with the manual use of the GLContext APIs. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@637 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/javax/media/opengl/Threading.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/classes/javax') diff --git a/src/classes/javax/media/opengl/Threading.java b/src/classes/javax/media/opengl/Threading.java index f8d54d95d..94de9e7d9 100755 --- a/src/classes/javax/media/opengl/Threading.java +++ b/src/classes/javax/media/opengl/Threading.java @@ -111,8 +111,10 @@ import com.sun.opengl.impl.*;
     -Dopengl.1thread=false     Disable single-threading of OpenGL work
-    -Dopengl.1thread=true      Enable single-threading of OpenGL work (default)
+    -Dopengl.1thread=true      Enable single-threading of OpenGL work (default -- on a newly-created worker thread)
     -Dopengl.1thread=auto      Select default single-threading behavior (currently on)
+    -Dopengl.1thread=worker    Enable single-threading of OpenGL work on newly-created worker thread (default)
+    -Dopengl.1thread=awt       Enable single-threading of OpenGL work on AWT event dispatch thread (the default behavior in older releases)
     
*/ @@ -120,7 +122,7 @@ public class Threading { private static boolean singleThreaded = true; private static final int AWT = 1; private static final int WORKER = 2; - private static int mode = AWT; + private static int mode = WORKER; static { AccessController.doPrivileged(new PrivilegedAction() { @@ -130,11 +132,11 @@ public class Threading { workaround = workaround.toLowerCase(); if (workaround.equals("true") || workaround.equals("auto") || - workaround.equals("awt")) { - // Nothing to do; default = singleThreaded, mode = AWT - } else if (workaround.equals("worker")) { + workaround.equals("worker")) { + // Nothing to do; default = singleThreaded, mode = WORKER + } else if (workaround.equals("awt")) { singleThreaded = true; - mode = WORKER; + mode = AWT; } else { singleThreaded = false; } -- cgit v1.2.3