aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-10-24 23:48:55 +0200
committerSven Gothel <[email protected]>2013-10-24 23:48:55 +0200
commitcbc641e89136098e0a9e79afe74b45203f828587 (patch)
tree5ed676b6f2b69e353773d60ff73499ed042adc83 /src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
parent970c9823007d1618e67480440ff40e7802dbb90f (diff)
Bug 867 - OSX: Allow core >=4 if isMavericksOrLater; Use [kCGLOGLPVersion_GL4_Core, kCGLOGLPVersion_GL3_Core] for major==4 depending on sticky GLRendererQuirks.GL4NeedsGL3Request
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index 13e249a58..481c0b94b 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -47,7 +47,6 @@ import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
-
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.nativewindow.MutableGraphicsConfiguration;
@@ -89,7 +88,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
CGL.NSOpenGLPFASampleBuffers,
CGL.NSOpenGLPFASamples });
- static IntBuffer GLCapabilities2NSAttribList(IntBuffer attrToken, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+ static IntBuffer GLCapabilities2NSAttribList(AbstractGraphicsDevice device, IntBuffer attrToken, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
final int len = attrToken.remaining();
final int off = attrToken.position();
final IntBuffer ivalues = Buffers.newDirectIntBuffer(len);
@@ -98,7 +97,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
final int attr = attrToken.get(idx+off);
switch (attr) {
case CGL.kCGLPFAOpenGLProfile:
- ivalues.put(idx, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(ctp, major, minor));
+ ivalues.put(idx, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(device, ctp, major, minor));
break;
case CGL.NSOpenGLPFANoRecovery:
ivalues.put(idx, caps.getHardwareAccelerated() ? 1 : 0);
@@ -156,13 +155,13 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
return ivalues;
}
- static long GLCapabilities2NSPixelFormat(GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+ static long GLCapabilities2NSPixelFormat(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
final IntBuffer attrToken = cglInternalAttributeToken.duplicate();
if ( !MacOSXCGLContext.isLionOrLater ) {
// no OpenGLProfile
attrToken.position(1);
}
- final IntBuffer ivalues = GLCapabilities2NSAttribList(attrToken, caps, ctp, major, minor);
+ final IntBuffer ivalues = GLCapabilities2NSAttribList(device, attrToken, caps, ctp, major, minor);
return CGL.createPixelFormat(attrToken, attrToken.remaining(), ivalues);
}
@@ -170,13 +169,13 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
return PixelFormat2GLCapabilities(glp, pixelFormat, true);
}
- static long GLCapabilities2CGLPixelFormat(GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+ static long GLCapabilities2CGLPixelFormat(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
// Set up pixel format attributes
final IntBuffer attrs = Buffers.newDirectIntBuffer(256);
int i = 0;
if(MacOSXCGLContext.isLionOrLater) {
attrs.put(i++, CGL.kCGLPFAOpenGLProfile);
- attrs.put(i++, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(ctp, major, minor));
+ attrs.put(i++, MacOSXCGLContext.GLProfile2CGLOGLProfileValue(device, ctp, major, minor));
}
/**
if(!caps.isOnscreen() && caps.isPBuffer()) {
@@ -261,7 +260,10 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
final int ivalue = ivalues.get(i);
if(CGL.kCGLPFAOpenGLProfile == attrToken.get(i+off)) {
switch(ivalue) {
- case CGL.kCGLOGLPVersion_3_2_Core:
+ case CGL.kCGLOGLPVersion_GL4_Core:
+ glp = GLProfile.get(GLProfile.GL4);
+ break;
+ case CGL.kCGLOGLPVersion_GL3_Core:
glp = GLProfile.get(GLProfile.GL3);
break;
case CGL.kCGLOGLPVersion_Legacy: