summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes')
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index eae365925..46c8252b6 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -503,12 +503,14 @@ public abstract class MacOSXCGLContext extends GLContextImpl
return 0;
}
GLCapabilities fixedCaps = MacOSXCGLGraphicsConfiguration.NSPixelFormat2GLCapabilities(chosenCaps.getGLProfile(), pixelFormat);
- if(chosenCaps.isOnscreen() || !fixedCaps.isPBuffer()) {
- // not handled, so copy them
- fixedCaps.setFBO(chosenCaps.isFBO());
- fixedCaps.setPBuffer(chosenCaps.isPBuffer());
- fixedCaps.setBitmap(chosenCaps.isBitmap());
- fixedCaps.setOnscreen(chosenCaps.isOnscreen());
+ if( !fixedCaps.isPBuffer() && isPBuffer ) {
+ throw new InternalError("handle is PBuffer, fixedCaps not: "+drawable);
+ }
+ { // determine on-/offscreen caps, since pformat is ambiguous
+ fixedCaps.setFBO( isFBO ); // exclusive
+ fixedCaps.setPBuffer( isPBuffer ); // exclusive
+ fixedCaps.setBitmap( false ); // n/a in our OSX impl.
+ fixedCaps.setOnscreen( !isFBO && !isPBuffer );
}
fixedCaps = GLGraphicsConfigurationUtil.fixOpaqueGLCapabilities(fixedCaps, chosenCaps.isBackgroundOpaque());
int sRefreshRate = OSXUtil.GetScreenRefreshRate(drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getIndex());
@@ -528,15 +530,6 @@ public abstract class MacOSXCGLContext extends GLContextImpl
System.err.println("NS create screen refresh-rate: "+sRefreshRate+" hz, "+screenVSyncTimeout+" micros");
// Thread.dumpStack();
}
- if(fixedCaps.isPBuffer()) {
- if(!isPBuffer) {
- throw new InternalError("fixedCaps is PBuffer, handle not: "+drawable);
- }
- } else {
- if(isPBuffer) {
- throw new InternalError("handle is PBuffer, fixedCaps not: "+drawable);
- }
- }
config.setChosenCapabilities(fixedCaps);
/**
if(null != backingLayerHost) {
@@ -817,13 +810,12 @@ public abstract class MacOSXCGLContext extends GLContextImpl
if (0 != ctx) {
GLCapabilities fixedCaps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(pixelFormat);
fixedCaps = GLGraphicsConfigurationUtil.fixOpaqueGLCapabilities(fixedCaps, chosenCaps.isBackgroundOpaque());
- if(chosenCaps.isOnscreen() || !fixedCaps.isPBuffer()) {
- // not handled, so copy them
- fixedCaps.setFBO(chosenCaps.isFBO());
- fixedCaps.setPBuffer(chosenCaps.isPBuffer());
- fixedCaps.setBitmap(chosenCaps.isBitmap());
- fixedCaps.setOnscreen(chosenCaps.isOnscreen());
- }
+ { // determine on-/offscreen caps, since pformat is ambiguous
+ fixedCaps.setFBO( false ); // n/a for CGLImpl
+ fixedCaps.setPBuffer( fixedCaps.isPBuffer() && !chosenCaps.isOnscreen() );
+ fixedCaps.setBitmap( false ); // n/a in our OSX impl.
+ fixedCaps.setOnscreen( !fixedCaps.isPBuffer() );
+ }
config.setChosenCapabilities(fixedCaps);
if(DEBUG) {
System.err.println("CGL create fixedCaps: "+fixedCaps);