diff options
Diffstat (limited to 'src')
3 files changed, 19 insertions, 9 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index b2f63cec4..17313f770 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -1393,12 +1393,16 @@ public class GLProfile { private static void dumpGLInfo(GLDrawableFactoryImpl factory, AbstractGraphicsDevice device) { GLContext ctx = factory.getOrCreateSharedContext(device); - System.err.println("GLProfile.dumpGLInfo: "+ctx); - ctx.makeCurrent(); - try { - System.err.println(JoglVersion.getGLInfo(ctx.getGL(), null)); - } finally { - ctx.release(); + if(null != ctx) { + System.err.println("GLProfile.dumpGLInfo: "+ctx); + ctx.makeCurrent(); + try { + System.err.println(JoglVersion.getGLInfo(ctx.getGL(), null)); + } finally { + ctx.release(); + } + } else { + System.err.println("GLProfile.dumpGLInfo: shared context n/a"); } } diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index 8e27c217b..fa0a0b6ed 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -50,6 +50,7 @@ import javax.media.opengl.*; import com.jogamp.common.JogampRuntimeException; import com.jogamp.common.util.*; +import java.util.ArrayList; import jogamp.opengl.*; import jogamp.nativewindow.WrappedSurface; @@ -127,7 +128,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { protected final void shutdownInstance() {} protected List/*GLCapabilitiesImmutable*/ getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) { - throw new UnsupportedOperationException("not yet implemented"); + return new ArrayList(0); } protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) { diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java index af055913d..6303f2e43 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java @@ -65,16 +65,17 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext { long contextHandle = CGL.getCurrentContext(); // Check: MacOSX 10.3 .. boolean isNSContext = 0 != contextHandle; if( isNSContext ) { - currentDrawable = CGL.getNSView(contextHandle); long ctx = CGL.getCGLContext(contextHandle); if (ctx == 0) { throw new GLException("Error: NULL Context (CGL) of Context (NS) 0x" +Long.toHexString(contextHandle)); } pixelFormat = CGL.CGLGetPixelFormat(ctx); + currentDrawable = CGL.getNSView(contextHandle); if(DEBUG) { System.err.println("MacOSXExternalCGLContext Create Context (NS) 0x"+Long.toHexString(contextHandle)+ ", Context (CGL) 0x"+Long.toHexString(ctx)+ - ", pixelFormat 0x"+Long.toHexString(pixelFormat)); + ", pixelFormat 0x"+Long.toHexString(pixelFormat)+ + ", drawable 0x"+Long.toHexString(currentDrawable)); } } else { contextHandle = CGL.CGLGetCurrentContext(); @@ -99,6 +100,10 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext { AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX); MacOSXCGLGraphicsConfiguration cfg = new MacOSXCGLGraphicsConfiguration(aScreen, caps, caps, pixelFormat); + if(0 == currentDrawable) { + // set a fake marker stating a valid drawable + currentDrawable = 1; + } WrappedSurface ns = new WrappedSurface(cfg); ns.setSurfaceHandle(currentDrawable); return new MacOSXExternalCGLContext(new Drawable(factory, ns), isNSContext, contextHandle); |