From 83f79535ff424cc31411c156ec4706ddd5bf0dd2 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 25 Apr 2011 10:20:41 +0200 Subject: GLContextImpl.createContextARB(..): Use impl. GLProfile to determine requested context .. this fixes the bug where [GL2ES2/GL4bc] didn't fetch GL4bc, but a GL2 old context. --- src/jogl/classes/jogamp/opengl/GLContextImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/jogl/classes/jogamp') diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index ee2686fd4..6128b30b4 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -542,6 +542,7 @@ public abstract class GLContextImpl extends GLContext { AbstractGraphicsDevice device = config.getScreen().getDevice(); GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities(); GLProfile glp = glCaps.getGLProfile(); + GLProfile glpImpl = GLProfile.get(glp.getImplName()); if (DEBUG) { System.err.println(getThreadName() + ": !!! createContextARB: mappedVersionsAvailableSet("+device.getConnection()+"): "+ @@ -553,15 +554,15 @@ public abstract class GLContextImpl extends GLContext { } int reqMajor; - if(glp.isGL4()) { + if(glpImpl.isGL4()) { reqMajor=4; - } else if (glp.isGL3()) { + } else if (glpImpl.isGL3()) { reqMajor=3; - } else /* if (glp.isGL2()) */ { + } else /* if (glpImpl.isGL2()) */ { reqMajor=2; } - boolean compat = glp.isGL2(); // incl GL3bc and GL4bc + boolean compat = glpImpl.isGL2(); // incl GL3bc and GL4bc int _major[] = { 0 }; int _minor[] = { 0 }; int _ctp[] = { 0 }; @@ -580,10 +581,10 @@ public abstract class GLContextImpl extends GLContext { private final void mapGLVersions(AbstractGraphicsDevice device) { synchronized (GLContext.deviceVersionAvailable) { - createContextARBMapVersionsAvailable(4, false /* core */); // GL4 createContextARBMapVersionsAvailable(4, true /* compat */); // GL4bc - createContextARBMapVersionsAvailable(3, false /* core */); // GL3 + createContextARBMapVersionsAvailable(4, false /* core */); // GL4 createContextARBMapVersionsAvailable(3, true /* compat */); // GL3bc + createContextARBMapVersionsAvailable(3, false /* core */); // GL3 createContextARBMapVersionsAvailable(2, true /* compat */); // GL2 GLContext.setAvailableGLVersionsSet(device); } -- cgit v1.2.3