diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/macosx')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java | 3 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java | 9 |
2 files changed, 9 insertions, 3 deletions
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); |