summaryrefslogtreecommitdiffstats
path: root/src/classes/javax/media/opengl/GLJPanel.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-07-10 20:18:26 +0000
committerKenneth Russel <[email protected]>2006-07-10 20:18:26 +0000
commita0c04406276133db40cd39799a0f845369385400 (patch)
treed9ce03523d051be40d49b546844cb60d0554b7ce /src/classes/javax/media/opengl/GLJPanel.java
parent67cf653d9a50a04a734c7cb4494392bc2687582c (diff)
Added code to support new entry points in
sun.java2d.opengl.CGLSurfaceData added by gziemski to enable the Java2D/JOGL bridge on Mac OS X. Currently untested. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@838 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media/opengl/GLJPanel.java')
-rw-r--r--src/classes/javax/media/opengl/GLJPanel.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/classes/javax/media/opengl/GLJPanel.java b/src/classes/javax/media/opengl/GLJPanel.java
index 192c5f1b1..6ab2a9ec7 100644
--- a/src/classes/javax/media/opengl/GLJPanel.java
+++ b/src/classes/javax/media/opengl/GLJPanel.java
@@ -551,8 +551,13 @@ public class GLJPanel extends JPanel implements GLAutoDrawable {
j2dSurface = curSurface;
}
if (joglContext == null) {
- joglDrawable = GLDrawableFactory.getFactory().createExternalGLDrawable();
- joglContext = joglDrawable.createContext(shareWith);
+ if (GLDrawableFactory.getFactory().canCreateExternalGLDrawable()) {
+ joglDrawable = GLDrawableFactory.getFactory().createExternalGLDrawable();
+ joglContext = joglDrawable.createContext(shareWith);
+ } else if (GLDrawableFactoryImpl.getFactoryImpl().canCreateContextOnJava2DSurface()) {
+ // Mac OS X code path
+ joglContext = GLDrawableFactoryImpl.getFactoryImpl().createContextOnJava2DSurface(g);
+ }
if (DEBUG) {
joglContext.setGL(new DebugGL(joglContext.getGL()));
}
@@ -563,6 +568,10 @@ public class GLJPanel extends JPanel implements GLAutoDrawable {
createNewDepthBuffer = true;
}
}
+ if (joglContext instanceof Java2DGLContext) {
+ // Mac OS X code path
+ ((Java2DGLContext) joglContext).setGraphics(g);
+ }
if (DEBUG && VERBOSE && Java2D.isFBOEnabled()) {
System.err.print("-- Surface type: ");