diff options
author | Sven Gothel <[email protected]> | 2011-12-13 02:30:47 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-13 02:30:47 +0100 |
commit | 84f50c99cf125e906555acd11e9375d693978d86 (patch) | |
tree | 6c3a918f5e53c9e6a2a9b879cae9959bd90c360c /src/jogl/classes/javax/media/opengl | |
parent | 567bc6a7266ca782051e052b8bab732fc8f92671 (diff) |
Fix GLDrawableFactory lack of GLProfile initialization in case get*Factory() is called 1st, add tests. Add performance numbers of init/shutdown in tests.
Diffstat (limited to 'src/jogl/classes/javax/media/opengl')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index ff8d00ebe..3f9700436 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -91,7 +91,6 @@ import javax.media.opengl.GLProfile.ShutdownType; */ public abstract class GLDrawableFactory { - private static final String nativeOSType; static final String macosxFactoryClassNameCGL = "jogamp.opengl.macosx.cgl.MacOSXCGLDrawableFactory"; static final String macosxFactoryClassNameAWTCGL = "jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory"; @@ -105,10 +104,6 @@ public abstract class GLDrawableFactory { private static boolean factoryShutdownHookRegistered = false; private static Thread factoryShutdownHook = null; - static { - nativeOSType = NativeWindowFactory.getNativeWindowType(true); - } - /** * Instantiate singleton factories if available, EGLES1, EGLES2 and the OS native ones. */ @@ -125,6 +120,7 @@ public abstract class GLDrawableFactory { private static final void initSingletonImpl() { registerFactoryShutdownHook(); + final String nativeOSType = NativeWindowFactory.getNativeWindowType(true); GLDrawableFactory tmp = null; String factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true, AccessController.getContext()); ClassLoader cl = GLDrawableFactory.class.getClassLoader(); @@ -297,7 +293,7 @@ public abstract class GLDrawableFactory { * Returns the sole GLDrawableFactory instance for the desktop (X11, WGL, ..) if exist or null */ public static GLDrawableFactory getDesktopFactory() { - initSingleton(); + GLProfile.initSingleton(); return nativeOSFactory; } @@ -305,7 +301,7 @@ public abstract class GLDrawableFactory { * Returns the sole GLDrawableFactory instance for EGL if exist or null */ public static GLDrawableFactory getEGLFactory() { - initSingleton(); + GLProfile.initSingleton(); return eglFactory; } |