diff options
author | Sven Gothel <[email protected]> | 2011-02-26 07:35:24 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-02-26 07:35:24 +0100 |
commit | 112e2a26004d974c3bba822fe1467a34784ec57d (patch) | |
tree | 560f5ff859587d142126beb0578ffc123d6ac99c /src/jogl/classes/jogamp | |
parent | 7f2079513b661c69b82f90770f4147530f8db8a2 (diff) |
GLProfile: More Tolerant for missing features; MacOSX: Fix External Context / SWT; SWT Test: Distinguish awt/headless and main-thread (osx) swt launch
Diffstat (limited to 'src/jogl/classes/jogamp')
-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); |