aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-10-11 07:41:31 -0700
committerSven Gothel <[email protected]>2009-10-11 07:41:31 -0700
commit8f76db4364f66c36780e762e086a18d5cc315363 (patch)
tree6c3291b08c76018bda59ad6fe3acf8fe686d0eb4 /src/jogl/classes/javax/media
parent6f6436ab9c7345f4d3b7bf5d8ee70addc9f11ab0 (diff)
NEWT X11 Display Lock:
Integrate Display.lock/unlock, so the generic Window will call it. Specialized for X11Display, the only real impl of it. Fixes offscreen EDT usage .. GLProfile: Add isAWTAvailable() and isAWTJOGLAvailable() TextureIO: - Add NetPbmTextureWriter - Only use IIOTexture* if !isAWTJOGLAvailable() - Add write (TextureData, File)
Diffstat (limited to 'src/jogl/classes/javax/media')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java17
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: