diff options
Diffstat (limited to 'src')
8 files changed, 14 insertions, 25 deletions
diff --git a/src/classes/linux/javax/media/j3d/NativeConfigTemplate3D.java b/src/classes/linux/javax/media/j3d/NativeConfigTemplate3D.java index 30cab7c..c938819 100644 --- a/src/classes/linux/javax/media/j3d/NativeConfigTemplate3D.java +++ b/src/classes/linux/javax/media/j3d/NativeConfigTemplate3D.java @@ -29,7 +29,6 @@ class NativeConfigTemplate3D { private final static boolean debug = false; NativeConfigTemplate3D() { - VirtualUniverse.createMC(); } /* diff --git a/src/classes/linux/javax/media/j3d/NativeScreenInfo.java b/src/classes/linux/javax/media/j3d/NativeScreenInfo.java index aac8fa6..b592af5 100644 --- a/src/classes/linux/javax/media/j3d/NativeScreenInfo.java +++ b/src/classes/linux/javax/media/j3d/NativeScreenInfo.java @@ -55,7 +55,6 @@ class NativeScreenInfo { } NativeScreenInfo(GraphicsDevice graphicsDevice) { - VirtualUniverse.createMC(); // Open a new static display connection if one is not already opened getStaticDisplay(); 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) { diff --git a/src/classes/solaris/javax/media/j3d/NativeConfigTemplate3D.java b/src/classes/solaris/javax/media/j3d/NativeConfigTemplate3D.java index 158c87f..cfd691f 100644 --- a/src/classes/solaris/javax/media/j3d/NativeConfigTemplate3D.java +++ b/src/classes/solaris/javax/media/j3d/NativeConfigTemplate3D.java @@ -23,7 +23,6 @@ class NativeConfigTemplate3D { private final static boolean debug = false; NativeConfigTemplate3D() { - VirtualUniverse.createMC(); } // These definitions should match those in win32 NativeConfigTemplate3D.java diff --git a/src/classes/solaris/javax/media/j3d/NativeScreenInfo.java b/src/classes/solaris/javax/media/j3d/NativeScreenInfo.java index 19c8967..b1e6e40 100644 --- a/src/classes/solaris/javax/media/j3d/NativeScreenInfo.java +++ b/src/classes/solaris/javax/media/j3d/NativeScreenInfo.java @@ -48,7 +48,6 @@ class NativeScreenInfo { } NativeScreenInfo(GraphicsDevice graphicsDevice) { - VirtualUniverse.createMC(); // Open a new static display connection if one is not already opened getStaticDisplay(); diff --git a/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java b/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java index eca5def..3a92b8a 100644 --- a/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java +++ b/src/classes/win32/javax/media/j3d/NativeConfigTemplate3D.java @@ -22,7 +22,6 @@ class NativeConfigTemplate3D { private final static boolean debug = false; NativeConfigTemplate3D() { - VirtualUniverse.createMC(); } // This definition should match those in solaris NativeConfigTemplate3D.java |