diff options
Diffstat (limited to 'src/classes/javax/media')
-rw-r--r-- | src/classes/javax/media/opengl/GLJPanel.java | 13 |
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: "); |