diff options
author | Sven Gothel <[email protected]> | 2012-02-13 12:38:53 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-02-13 12:38:53 +0100 |
commit | 5af2d74b9ae106d75895baf4757f4d41c39761d5 (patch) | |
tree | 77ce5a8116d40f5ffdaed3fa3af444c0a998b2f0 /src/jogl/classes/jogamp/opengl/awt/Java2D.java | |
parent | 03b15ec0efc5af944da7d65aadab3a4bdf2e6c68 (diff) |
Java2D OGLPipeline: Disabled for Max OSX
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/awt/Java2D.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/awt/Java2D.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java index b5530fc2f..3dbfefb19 100644 --- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java +++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java @@ -57,6 +57,8 @@ import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLException; import javax.media.opengl.GLProfile; +import com.jogamp.common.os.Platform; + import jogamp.opengl.Debug; @@ -117,6 +119,7 @@ public class Java2D { if (DEBUG) { System.err.println("Checking for Java2D/OpenGL support"); } + Throwable catched = null; try { isHeadless = true; // Figure out whether the default graphics configuration is an @@ -131,7 +134,8 @@ public class Java2D { if (DEBUG) { System.err.println("Java2D support: default GraphicsConfiguration = " + name); } - isOGLPipelineActive = (name.startsWith("sun.java2d.opengl")); + isOGLPipelineActive = Platform.OS_TYPE != Platform.OSType.MACOS && + (name.startsWith("sun.java2d.opengl")); if (isOGLPipelineActive) { try { @@ -243,8 +247,8 @@ public class Java2D { destroyOGLContextMethod.setAccessible(true); } } catch (Exception e) { + catched = e; if (DEBUG) { - e.printStackTrace(); System.err.println("Info: Disabling Java2D/JOGL integration"); } isOGLPipelineActive = false; @@ -252,9 +256,15 @@ public class Java2D { } } catch (HeadlessException e) { // The AWT is running in headless mode, so the Java 2D / JOGL bridge is clearly disabled + } catch (Error e) { + // issued on OSX Java7: java.lang.Error: Could not find class: sun.awt.HeadlessGraphicsEnvironment + catched = e; } if (DEBUG) { + if(null != catched) { + catched.printStackTrace(); + } System.err.println("JOGL/Java2D integration " + (isOGLPipelineActive ? "enabled" : "disabled")); } return null; |