From 2fe180fbee15b82e2ae14fe3c95887db246c874d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 27 Jan 2013 14:08:07 +0100 Subject: Bug 665 (part 3) - Allow dis-association of GLContext's GLDrawable .. - Add EGL/ES2 tests, attempt to fix wrapped EGL case - Bug 665 (part 2) was commit 7fd5f76e1eb4bbf93fe9b1171744bd755d8f96e4 - Add EGL/ES2 tests in - TestGLContextDrawableSwitch01NEWT - TestGLContextDrawableSwitch11NEWT - Attempt to fix wrapped EGL case (incomplete) - Using EGL/ES w/ non native EGL device/surface, but natively wrapped instances (most of the cases), a 'complicated' delegation of Native-Upstream -> EGL-Proxy -> EGL-Instance is being used heavily relying on the objects lifecycle. GLEventListenerState tries to roll back the realized state and even sets the upstream device handle, but this doesn't seem to be sufficient on X11. Discussion: It might turn out that we only can implement the survival of GLContext and it's display device reliable w/ EGL within the GLAutoDrawable implementation, which can hold the previous not destructed instances. --- src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java | 2 +- .../classes/javax/media/nativewindow/NativeWindowFactory.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/nativewindow/classes/javax/media') diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java index 27462ae70..a89caec76 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java @@ -56,7 +56,7 @@ public interface NativeSurface extends SurfaceUpdatedListener { * ie return a value other than {@link #LOCK_SURFACE_UNLOCKED} and {@link #LOCK_SURFACE_NOT_READY}, * which is *
 
-   *    boolean ok = lockSurface() > LOCK_SURFACE_NOT_READY; 
+   *    boolean ok = LOCK_SURFACE_NOT_READY < lockSurface(); 
    * 
*

*

diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index 07702c762..b6a052253 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -435,9 +435,10 @@ public abstract class NativeWindowFactory { /** * @param device * @param screen -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen - * @return newly created AbstractGraphicsScreen of given native type + * @return newly created AbstractGraphicsScreen matching device's native type */ - public static AbstractGraphicsScreen createScreen(String type, AbstractGraphicsDevice device, int screen) { + public static AbstractGraphicsScreen createScreen(AbstractGraphicsDevice device, int screen) { + final String type = device.getType(); if( TYPE_X11 == type ) { final X11GraphicsDevice x11Device = (X11GraphicsDevice)device; if(0 > screen) { -- cgit v1.2.3