diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/GLContext.java | 3 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/GLProfile.java | 22 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLContext.java b/src/jogl/classes/com/jogamp/opengl/GLContext.java index 88fed4450..4455633a1 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/GLContext.java @@ -1647,6 +1647,9 @@ public abstract class GLContext { ctp[0] = ( bits32 & 0x0000FFFF ) ; return new VersionNumber(major, minor, 0); } + protected static int getCTPFromBits(final int bits32) { + return ( bits32 & 0x0000FFFF ); + } protected static void validateProfileBits(final int bits, final String argName) { int num = 0; diff --git a/src/jogl/classes/com/jogamp/opengl/GLProfile.java b/src/jogl/classes/com/jogamp/opengl/GLProfile.java index c52e3136e..8612fc73f 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLProfile.java +++ b/src/jogl/classes/com/jogamp/opengl/GLProfile.java @@ -1982,8 +1982,16 @@ public class GLProfile { } } - if( !addedDesktopProfile && !addedMobileProfile ) { - setProfileMap(device, new HashMap<String /*GLProfile_name*/, GLProfile>()); // empty + final HashMap<String, GLProfile> mappedAllProfiles; + if( addedMobileProfile ) { + // If run on actual desktop device, e.g. '.x11_:0_0', + // GLContextImpl.remapAvailableGLVersion('.egl_:0_0' -> '.x11_:0_0') + // ensures EGL profiles being mapped to upstream desktop device '.x11_:0_0'. + mappedAllProfiles = mappedEGLProfiles; + } else if( addedDesktopProfile ) { + mappedAllProfiles = mappedDesktopProfiles; + } else { + mappedAllProfiles = new HashMap<String /*GLProfile_name*/, GLProfile>(); // empty if(DEBUG) { System.err.println("GLProfile: device could not be initialized: "+device); System.err.println("GLProfile: compatible w/ desktop: "+deviceIsDesktopCompatible+ @@ -1993,16 +2001,8 @@ public class GLProfile { System.err.println("GLProfile: hasGLES1Impl "+hasGLES1Impl); System.err.println("GLProfile: hasGLES3Impl "+hasGLES3Impl); } - } else { - final HashMap<String, GLProfile> mappedAllProfiles = new HashMap<String, GLProfile>(); - if( addedMobileProfile ) { - mappedAllProfiles.putAll(mappedEGLProfiles); - } - if( addedDesktopProfile ) { - mappedAllProfiles.putAll(mappedDesktopProfiles); - } - setProfileMap(device, mappedAllProfiles); // union } + setProfileMap(device, mappedAllProfiles); // merged mappedEGLProfiles if available, otherwise mappedDesktopProfiles GLContext.setAvailableGLVersionsSet(device, true); |