aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-26 06:19:33 +0100
committerSven Gothel <[email protected]>2011-11-26 06:19:33 +0100
commit50100b85ce5fde48788efbc2211b26fb9d7c9dfd (patch)
treed0b1c85ea867d01474934e28af7281973888e03c /src
parent8a7ebf29156ac886a267fe32d78baede009a638f (diff)
NEWT X11Display: Use default X11 locking for X11GraphicsDevice
Due to Display's reusage and hence concurrent involvement in off-thread animation, the X11 default lock is required. In case you require 2 GLWindow's w/o interference to each other (ie. locking), you need to use separate Display instances.
Diffstat (limited to 'src')
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/X11Display.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Display.java b/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
index b2437ab37..227dd7439 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
@@ -34,10 +34,13 @@
package jogamp.newt.driver.x11;
-import javax.media.nativewindow.*;
-import javax.media.nativewindow.x11.*;
-import jogamp.newt.*;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.x11.X11GraphicsDevice;
+
import jogamp.nativewindow.x11.X11Util;
+import jogamp.newt.DisplayImpl;
+import jogamp.newt.NEWTJNILibLoader;
public class X11Display extends DisplayImpl {
@@ -65,6 +68,13 @@ public class X11Display extends DisplayImpl {
return X11Util.validateDisplayName(name, handle);
}
+ /**
+ * {@inheritDoc}
+ *
+ * We use a private non-shared X11 Display instance for EDT window operations and one for exposed animation, eg. OpenGL.
+ * Since it is possible to share this device via {@link com.jogamp.newt.NewtFactory#createDisplay(String, boolean)},
+ * we have to supply it w/ basic locking, implicit to the constructor {@link X11GraphicsDevice#X11GraphicsDevice(long, int, boolean)}.
+ */
protected void createNativeImpl() {
long handle = X11Util.openDisplay(name);
if( 0 == handle ) {
@@ -86,8 +96,8 @@ public class X11Display extends DisplayImpl {
throw e;
}
- // We use a private non-shared X11 Display instance for EDT window operations and one for exposed animation, eg. OpenGL
- aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, NativeWindowFactory.getNullToolkitLock(), false);
+ // see API doc above!
+ aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, false);
}
protected void closeNativeImpl() {