diff options
author | Sven Gothel <[email protected]> | 2010-12-03 21:32:16 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-12-03 21:32:16 +0100 |
commit | 4b9ad2508ff31a03d3bc4482d812a6cbc0c5c33b (patch) | |
tree | 28212ee090a08c3fae1943a26e6ac4633ecc5090 /src/nativewindow/classes/javax/media | |
parent | de9211df2c1654db889bb5d5c43297ed7d6499ba (diff) |
Cleanup GLDrawableFactory API and platform Implementations
- Finish API change using the AbstractGraphicsDevice, which denotes the target device
for the desired NativeSurface / GLDrawable.
The AbstractGraphicsDevice argument may be null to reflect the platform's default device.
Clarified API documentation.
This move is necessary to make the API coherent.
- createOffscreenDrawable(..) may create a Pbuffer drawable if caps and supported.
This unifies the functionality with createGLDrawable(..).
Further more, a Pbuffer drawable is an offscreen as well.
- added createOffscreenSurface(..) following the same behavior as createOffscreenDrawable(..),
this is a convenient native offscreen surface factory entry.
- removed createGLPbufferDrawable(..), use createOffscreenDrawable(..),
since it is redundant!
Implementation Details:
- EGLDrawableFactory holds a shared native EGLGraphicsDevice,
being used by the offscreen EGL drawable (no more multiple creation).
Diffstat (limited to 'src/nativewindow/classes/javax/media')
3 files changed, 13 insertions, 7 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java index 7bd27fdba..2dfd9f0ee 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java @@ -38,19 +38,21 @@ import javax.media.nativewindow.*; */ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneable { + boolean closeDisplay = false; + /** * Note that this is not an open connection, ie no native display handle exist. * This constructor exist to setup a default device connection/unit.<br> */ - public EGLGraphicsDevice(int unitID) { - super(NativeWindowFactory.TYPE_EGL, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID); + public EGLGraphicsDevice(String connection, int unitID) { + super(NativeWindowFactory.TYPE_EGL, connection, unitID); } /** Constructs a new EGLGraphicsDevice corresponding to the given EGL display handle. */ - public EGLGraphicsDevice(long eglDisplay, int unitID) { - super(NativeWindowFactory.TYPE_EGL, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID, eglDisplay); + public EGLGraphicsDevice(long eglDisplay, String connection, int unitID) { + super(NativeWindowFactory.TYPE_EGL, connection, unitID, eglDisplay); } - + public Object clone() { return super.clone(); } diff --git a/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java index d5e32381b..5d0129e0d 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java @@ -40,7 +40,11 @@ import javax.media.nativewindow.*; public class WindowsGraphicsDevice extends DefaultGraphicsDevice implements Cloneable { /** Constructs a new WindowsGraphicsDevice */ public WindowsGraphicsDevice(int unitID) { - super(NativeWindowFactory.TYPE_WINDOWS, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID); + this(AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID); + } + + public WindowsGraphicsDevice(String connection, int unitID) { + super(NativeWindowFactory.TYPE_WINDOWS, connection, unitID); } public Object clone() { diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java index 31e03f8f1..949afe5bd 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java +++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java @@ -86,7 +86,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl handle = 0; return true; } - return true; + return false; } } |