diff options
author | Kevin Rushforth <[email protected]> | 2004-11-03 20:57:14 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2004-11-03 20:57:14 +0000 |
commit | 7b97aa387b8933c7e0ba61256fe3b11b1b8b189b (patch) | |
tree | b0b2f05ca0f1e43e73b2ffd9abb77cec64795f48 /src/classes | |
parent | 2b8ae14735ffdea883a31120af4b31554f6d1498 (diff) |
1. Fixed a problem in setOffScreenBuffer that prevented native off-screen buffer from being created after a live scene graph was removed. With yesterday's fix, this caused a deadlock to occur.
2. Cleanup in construction of the MasterControl object.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@68 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes')
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 |