From 9e66972c193399d6dcdf9e6662f4335bdf15736a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 25 Feb 2012 17:27:23 +0100 Subject: Fix GLProfile/GLDrawableFactory bug: Recursion on default desktop device, since no profile was mapped. GLDrawableFactory*: - Initialize defaultDevice, even if impl. is not available (no GL libraries for impl.), hence - getDefaultDevice() always returns a valid device - getIsDeviceCompatible() only returns 'true' if device is supported _and_ drawable factory is functional GLProfile: - default-desktop-device becomes default-device even if the desktop-factory itself is not functional. This is due to the fact that the subsequent EGL-factory always handles desktop-devices (X11->EGL, GDI->EGL, etc). --- src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/egl') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index 2a6985d90..1ab66674b 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -70,6 +70,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } catch (JogampRuntimeException jre) { /* n/a .. */ } } + defaultDevice = new EGLGraphicsDevice(AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); + // FIXME: Probably need to move EGL from a static model // to a dynamic one, where there can be 2 instances // for each ES profile with their own ProcAddressTable. @@ -139,9 +141,6 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } } } - if(null != eglES1DynamicLookupHelper || null != eglES2DynamicLookupHelper) { - defaultDevice = new EGLGraphicsDevice(AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); - } } protected final void destroy(ShutdownType shutdownType) { @@ -206,7 +205,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) { - return true; // via mappings (X11/WGL/.. -> EGL) we shall be able to handle all types. + // via mappings (X11/WGL/.. -> EGL) we shall be able to handle all types. + return null==eglES2DynamicLookupHelper || null==eglES1DynamicLookupHelper; } /** -- cgit v1.2.3