From e5a55ede324ce500f50991d56491758803063a58 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 30 Jul 2014 03:06:30 +0200 Subject: Bug 1038 - Allow skipping detection of certain GLProfiles: Skip 'ARB_create_context' context creation extension via property 'jogl.disable.openglarbcontext'; ... Only allow the exclusions if platform OS is not OSX: - jogl.disable.openglcore - jogl.disable.openglarbcontext Since on OSX they are known to work reliable and there is not other method if receiving a higher GL profile than core and ARB. This also removes the restrictions on X11 and Windows, where profiles >= GL3 must be created using ARB_create_context. Hence this is allowed now. --- src/jogl/classes/javax/media/opengl/GLProfile.java | 33 ++++++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index dec5bc821..d39d0f11a 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -44,6 +44,7 @@ import jogamp.opengl.DesktopGLDynamicLookupHelper; import com.jogamp.common.GlueGenVersion; import com.jogamp.common.jvm.JNILibLoaderBase; import com.jogamp.common.os.Platform; +import com.jogamp.common.util.PropertyAccess; import com.jogamp.common.util.ReflectionUtil; import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.cache.TempJarCache; @@ -75,21 +76,34 @@ import java.util.Map; */ public class GLProfile { - public static final boolean DEBUG = Debug.debug("GLProfile"); + public static final boolean DEBUG; /** * In case no OpenGL ES profiles are required - * and if the running platform may have a buggy implementation, + * and if one platform may have a buggy implementation, * setting the property jogl.disable.opengles disables querying possible existing OpenGL ES profiles. */ - public static final boolean disableOpenGLES = Debug.isPropertyDefined("jogl.disable.opengles", true); + public static final boolean disableOpenGLES; /** * In case no native OpenGL core profiles are required - * and if the running platform may have a buggy implementation, + * and if one platform may have a buggy implementation, * setting the property jogl.disable.openglcore disables querying possible existing native OpenGL core profiles. + *

+ * This exclusion is disabled for {@link Platform.OSType#MACOS}. + *

+ */ + public static final boolean disableOpenGLCore; + + /** + * In case the implementation of the ARB_create_context + * context creation extension is buggy on one platform, + * setting the property jogl.disable.openglarbcontext disables utilizing it. + *

+ * This exclusion is disabled for {@link Platform.OSType#MACOS}. + *

*/ - public static final boolean disableOpenGLCore = Debug.isPropertyDefined("jogl.disable.openglcore", true); + public static final boolean disableOpenGLARBContext; /** * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome. @@ -99,11 +113,18 @@ public class GLProfile { * jogl.enable.ANGLE. *

*/ - public static final boolean enableANGLE = Debug.isPropertyDefined("jogl.enable.ANGLE", true); + public static final boolean enableANGLE; static { // Also initializes TempJarCache if shall be used. Platform.initSingleton(); + final boolean isOSX = Platform.OSType.MACOS == Platform.getOSType(); + + DEBUG = Debug.debug("GLProfile"); + disableOpenGLES = PropertyAccess.isPropertyDefined("jogl.disable.opengles", true); + disableOpenGLCore = PropertyAccess.isPropertyDefined("jogl.disable.openglcore", true) && !isOSX; + disableOpenGLARBContext = PropertyAccess.isPropertyDefined("jogl.disable.openglarbcontext", true) && !isOSX; + enableANGLE = PropertyAccess.isPropertyDefined("jogl.enable.ANGLE", true); } /** -- cgit v1.2.3