aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/macosx
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-26 16:33:55 +0100
committerSven Gothel <[email protected]>2015-03-26 16:33:55 +0100
commite0ed09f8e2df570a9542f606a133c8fde074cbfe (patch)
treebf6df61a15771999212290b369a88620ddc8040d /src/jogl/classes/jogamp/opengl/macosx
parent590b5bed36622933f452caf1db18b4dd16a75669 (diff)
Bug 1150 - Fix GLContextImpl.createImpl(..) NoARBCreateContext and '!ARB GL >= 3.1' issues
This fix solves the described issues below. Test cases added for onscreen and offscreen drawables, the latter includes Window's bitmap special case. GLContextImpl.createImpl(..): Fix NoARBCreateContext and '!ARB GL >= 3.1' issues: ================================================================================= GLContextImpl.createImpl(..) implementation of X11GLXContext and WindowsWGLContext wrongly handles the case of NoARBCreateContext. Here the !ARB created context shall allow GL >= 3.1, since ARB context creation is disabled and 'no mix' can occur. The latter was already intended due to failure criteris 'createContextARBTried' in: if( glCaps.getGLProfile().isGL3() && createContextARBTried ) { failure("createImpl ctx !ARB but ARB is used, profile > GL2 requested"); } Further, WindowsWGLContext treats glCaps.isBitmap() within the 'createContextARBTried=true' case, but it shall never tried using the ARB context creation method. This even lead to the issue of creating a 1.1 context, but having the ProcAddressTable being still on the GL > 2 cached table. This is due to 'setGLFunctionAvailability(..)'. Ensure 'setGLFunctionAvailability(..)' is functional ==================================================== Caller shall either throws an exception if method returns false or issues a state reset. In case 'setGLFunctionAvailability(..)' throws an exception itself, the states are no issue.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/macosx')
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 3c22e612f..d4fc0b005 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -289,8 +289,15 @@ public class MacOSXCGLContext extends GLContextImpl
@Override
protected boolean createImpl(final long shareWithHandle) throws GLException {
final MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration();
- final GLCapabilitiesImmutable capabilitiesChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities();
- final GLProfile glp = capabilitiesChosen.getGLProfile();
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+ final GLProfile glp = glCaps.getGLProfile();
+ final boolean createContextARBAvailable = isCreateContextARBAvail(device);
+ if(DEBUG) {
+ System.err.println(getThreadName() + ": MacOSXCGLContext.createImpl: START "+glCaps+", share "+toHexString(shareWithHandle));
+ System.err.println(getThreadName() + ": Use ARB[avail["+getCreateContextARBAvailStr(device)+
+ "] -> "+createContextARBAvailable+"]]");
+ }
if( glp.isGLES() ||
( glp.isGL3() && !isLionOrLater ) || ( glp.isGL4() && !isMavericksOrLater ) ) {
throw new GLException("OpenGL profile not supported on MacOSX "+Platform.getOSVersionNumber()+": "+glp);