diff options
Diffstat (limited to 'src/classes/share')
-rw-r--r-- | src/classes/share/javax/media/j3d/Canvas3D.java | 2 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/MasterControl.java | 13 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/VirtualUniverse.java | 19 |
3 files changed, 14 insertions, 20 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java index 5b2af1f..4505897 100644 --- a/src/classes/share/javax/media/j3d/Canvas3D.java +++ b/src/classes/share/javax/media/j3d/Canvas3D.java @@ -1127,8 +1127,6 @@ public class Canvas3D extends Canvas { (J3dI18N.getString("Canvas3D17")); } - VirtualUniverse.createMC(); - this.offScreen = offScreen; this.graphicsConfiguration = graphicsConfiguration; diff --git a/src/classes/share/javax/media/j3d/MasterControl.java b/src/classes/share/javax/media/j3d/MasterControl.java index 04cf953..e6ddcc3 100644 --- a/src/classes/share/javax/media/j3d/MasterControl.java +++ b/src/classes/share/javax/media/j3d/MasterControl.java @@ -2792,6 +2792,19 @@ class MasterControl { J3dDebug.doAssert((Screen3D.deviceRendererMap.get(gd) != null), "Screen3D.deviceRendererMap.get(gd) != null"); + // Create the master control thread if it isn't already created + boolean needToSetWork = false; + synchronized (mcThreadLock) { + if (mcThread == null) { + //System.err.println("Calling createMasterControlThread()"); + createMasterControlThread(); + needToSetWork = true; + } + } + if (needToSetWork) { + setWork(); + } + // Fix for Issue 72 : call createRenderer rather than getting // the renderer from the canvas.screen object Renderer rdr = createRenderer(c.graphicsConfiguration); diff --git a/src/classes/share/javax/media/j3d/VirtualUniverse.java b/src/classes/share/javax/media/j3d/VirtualUniverse.java index 9d9273d..26a34db 100644 --- a/src/classes/share/javax/media/j3d/VirtualUniverse.java +++ b/src/classes/share/javax/media/j3d/VirtualUniverse.java @@ -144,9 +144,6 @@ public class VirtualUniverse extends Object { // Root ThreadGroup for creating Java 3D threads static ThreadGroup rootThreadGroup; - // Lock for MasterControl Object creation - static Object mcLock = new Object(); - // Properties object for getProperties private static J3dQueryProps properties = null; @@ -192,20 +189,6 @@ public class VirtualUniverse extends Object { } - static void createMC() { - synchronized (mcLock) { - if (mc == null) { - mc = new MasterControl(); - } - } - } - - static void destroyMC() { - synchronized (mcLock) { - mc = null; - } - } - /** * Initialize the native interface and anything else that needs * to be initialized. @@ -252,7 +235,7 @@ public class VirtualUniverse extends Object { // Load the native libraries and create the static // MasterControl object MasterControl.loadLibraries(); - createMC(); + mc = new MasterControl(); // Print out debugging information for debug builds if(VersionInfo.isDebug) { |