diff options
Diffstat (limited to 'src/jogl/classes/javax/media')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLProfile.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 756c80009..abb6ca4f3 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -605,6 +605,9 @@ public class GLProfile implements Cloneable { // This is here only to avoid having separate GL2ES1Impl and GL2ES2Impl classes private static final String GL2ES12 = "GL2ES12"; + private static final boolean isAWTAvailable; + private static final boolean isAWTJOGLAvailable; + private static final boolean hasGL3Impl; private static final boolean hasGL2Impl; private static final boolean hasGL2ES12Impl; @@ -624,6 +627,15 @@ public class GLProfile implements Cloneable { static { JVMUtil.initSingleton(); + AccessControlContext acc = AccessController.getContext(); + + isAWTAvailable = !Debug.getBooleanProperty("java.awt.headless", true, acc) && + NWReflection.isClassAvailable("java.awt.Component") ; + + isAWTJOGLAvailable = isAWTAvailable && + NWReflection.isClassAvailable("javax.media.nativewindow.awt.AWTGraphicsDevice") && // NativeWindow + NWReflection.isClassAvailable("javax.media.opengl.awt.GLCanvas") ; // JOGL + boolean hasDesktopGL = false; boolean hasDesktopGLES12 = false; boolean hasNativeOSFactory = false; @@ -711,6 +723,8 @@ public class GLProfile implements Cloneable { hasGLES1Impl = btest; if (DEBUG) { + System.err.println("GLProfile.static isAWTAvailable "+isAWTAvailable); + System.err.println("GLProfile.static isAWTJOGLAvailable "+isAWTJOGLAvailable); System.err.println("GLProfile.static hasNativeOSFactory "+hasNativeOSFactory); System.err.println("GLProfile.static hasDesktopGLES12 "+hasDesktopGLES12); System.err.println("GLProfile.static hasDesktopGL "+hasDesktopGL); @@ -799,6 +813,9 @@ public class GLProfile implements Cloneable { return null; } + public static boolean isAWTAvailable() { return isAWTAvailable; } + public static boolean isAWTJOGLAvailable() { return isAWTJOGLAvailable; } + public static String getGLTypeName(int type) { switch (type) { case GL.GL_UNSIGNED_BYTE: |