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). --- .../classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/macosx') diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index 91d05f945..5327f7bf5 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -97,6 +97,8 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } } + defaultDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT); + if(null!=macOSXCGLDynamicLookupHelper) { // Register our GraphicsConfigurationFactory implementations // The act of constructing them causes them to be registered @@ -108,7 +110,6 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } catch (JogampRuntimeException jre) { /* n/a .. */ } } - defaultDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT); sharedMap = new HashMap(); } } @@ -167,7 +168,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) { - if(device instanceof MacOSXGraphicsDevice) { + if(null!=macOSXCGLDynamicLookupHelper && device instanceof MacOSXGraphicsDevice) { return true; } return false; -- cgit v1.2.3