From 101e229fa2f15b3492889205884ca98b1e9b3fbd Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 3 Sep 2014 23:32:52 +0200 Subject: Bug 1060 - Add GLProfile.isInitialized(): Returns true if JOGL has been initialized --- src/jogl/classes/javax/media/opengl/GLProfile.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/jogl/classes/javax/media/opengl') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 5836e4c81..08712e488 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -127,6 +127,21 @@ public class GLProfile { enableANGLE = PropertyAccess.isPropertyDefined("jogl.enable.ANGLE", true); } + /** + * @return true if JOGL has been initialized, i.e. manually via {@link #initSingleton()} or implicit, + * otherwise returns false. + * + * @since 2.2.1 + */ + public static boolean isInitialized() { + initLock.lock(); + try { + return initialized; + } finally { + initLock.unlock(); + } + } + /** * Static initialization of JOGL. * -- cgit v1.2.3