From 84f50c99cf125e906555acd11e9375d693978d86 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 13 Dec 2011 02:30:47 +0100 Subject: Fix GLDrawableFactory lack of GLProfile initialization in case get*Factory() is called 1st, add tests. Add performance numbers of init/shutdown in tests. --- src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/jogl/classes/javax') 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; } -- cgit v1.2.3