diff options
author | Sven Gothel <[email protected]> | 2014-07-29 22:55:56 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-29 22:55:56 +0200 |
commit | d55f1061a64f92d702a7f218d2f866fa4d5fa9dc (patch) | |
tree | cef98a76eb224d34b9441de92c0546527bc28198 | |
parent | 53c6a6cde3b57b54c71b9c1dc341c46854e33487 (diff) |
Bug 1038 - Allow skipping detection of certain GLProfiles: Skip native core profiles via property 'jogl.disable.openglcore'
Also moved all GL profile properties to GLProfile class and made them public for better documentation.
-rw-r--r-- | make/scripts/tests.sh | 5 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 19 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLProfile.java | 24 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 36 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | 2 |
5 files changed, 48 insertions, 38 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index a8984f3e2..55cb3e715 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -116,6 +116,7 @@ function jrun() { #D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_XCLOSEDISPLAY_BUG" #D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_MULTITHREADING_BUG" #D_ARGS="-Djogl.disable.opengles" + D_ARGS="-Djogl.disable.openglcore" #D_ARGS="-Djogl.debug.DebugGL -Dnewt.debug.Window" #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.FBObject" #D_ARGS="-Djogl.debug.FBObject -Djogl.debug.TraceGL -Djogl.debug.GLBufferStateTracker" @@ -368,7 +369,7 @@ function testawtswt() { #testnoawt com.jogamp.newt.NewtVersion $* #testnoawt com.jogamp.oculusvr.OVRVersion $* -#testnoawt com.jogamp.newt.opengl.GLWindow $* +testnoawt com.jogamp.newt.opengl.GLWindow $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLVersionParsing00NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLWindowNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLCanvasAWT $* @@ -509,7 +510,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestFBOMix2DemosES2NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestFBOMRTNEWT01 $* -testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLPointsNEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLPointsNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLMesaBug651NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLMesaBug658NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestX11DefaultDisplay $* diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index c11195c58..71568ee76 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -98,23 +98,6 @@ public abstract class GLDrawableFactory { protected static final boolean DEBUG = Debug.debug("GLDrawable"); - /** - * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome. - * When run in the mentioned browsers, the eglInitialize(..) implementation crashes. - * <p> - * This can be overridden by explicitly enabling ANGLE on Windows by setting the property - * <code>jogl.enable.ANGLE</code>. - * </p> - */ - protected static final boolean enableANGLE = Debug.isPropertyDefined("jogl.enable.ANGLE", true); - - /** - * In case no OpenGL ES implementation is required - * and if the running platform may have a buggy implementation, - * setting the property <code>jogl.disable.opengles</code> disables querying a possible existing OpenGL ES implementation. - */ - protected static final boolean disableOpenGLES = Debug.isPropertyDefined("jogl.disable.opengles", true); - private static volatile boolean isInit = false; private static GLDrawableFactory eglFactory; private static GLDrawableFactory nativeOSFactory; @@ -179,7 +162,7 @@ public abstract class GLDrawableFactory { } tmp = null; - if(!disableOpenGLES) { + if(!GLProfile.disableOpenGLES) { try { tmp = (GLDrawableFactory) ReflectionUtil.createInstance("jogamp.opengl.egl.EGLDrawableFactory", cl); } catch (final Exception jre) { diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 5c70ec675..dec5bc821 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -77,6 +77,30 @@ public class GLProfile { public static final boolean DEBUG = Debug.debug("GLProfile"); + /** + * In case no OpenGL ES profiles are required + * and if the running platform may have a buggy implementation, + * setting the property <code>jogl.disable.opengles</code> disables querying possible existing OpenGL ES profiles. + */ + public static final boolean disableOpenGLES = Debug.isPropertyDefined("jogl.disable.opengles", true); + + /** + * In case no native OpenGL core profiles are required + * and if the running platform may have a buggy implementation, + * setting the property <code>jogl.disable.openglcore</code> disables querying possible existing native OpenGL core profiles. + */ + public static final boolean disableOpenGLCore = Debug.isPropertyDefined("jogl.disable.openglcore", true); + + /** + * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome. + * When run in the mentioned browsers, the eglInitialize(..) implementation crashes. + * <p> + * This can be overridden by explicitly enabling ANGLE on Windows by setting the property + * <code>jogl.enable.ANGLE</code>. + * </p> + */ + public static final boolean enableANGLE = Debug.isPropertyDefined("jogl.enable.ANGLE", true); + static { // Also initializes TempJarCache if shall be used. Platform.initSingleton(); diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index d7578b9ea..ac9e1e53c 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -881,7 +881,7 @@ public abstract class GLContextImpl extends GLContext { /** * OSX 10.9 GLRendererQuirks.GL4NeedsGL3Request, quirk is added as usual @ setRendererQuirks(..) */ - if( !hasGL4 && !hasGL3 ) { + if( !GLProfile.disableOpenGLCore && !hasGL4 && !hasGL3 ) { hasGL3 = createContextARBMapVersionsAvailable(3, CTX_PROFILE_CORE); // GL3 success |= hasGL3; if( hasGL3 ) { @@ -898,25 +898,27 @@ public abstract class GLContextImpl extends GLContext { } } } - if( !hasGL4 ) { - hasGL4 = createContextARBMapVersionsAvailable(4, CTX_PROFILE_CORE); // GL4 - success |= hasGL4; - if( hasGL4 ) { - if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctxOptions ) ) { - // Map hw-accel GL4 to all lower core profiles: GL3 - GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions); - if( PROFILE_ALIASING ) { - hasGL3 = true; + if( !GLProfile.disableOpenGLCore ) { + if( !hasGL4 ) { + hasGL4 = createContextARBMapVersionsAvailable(4, CTX_PROFILE_CORE); // GL4 + success |= hasGL4; + if( hasGL4 ) { + if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctxOptions ) ) { + // Map hw-accel GL4 to all lower core profiles: GL3 + GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions); + if( PROFILE_ALIASING ) { + hasGL3 = true; + } } + resetStates(false); // clean context states, since creation was temporary } - resetStates(false); // clean context states, since creation was temporary } - } - if( !hasGL3 ) { - hasGL3 = createContextARBMapVersionsAvailable(3, CTX_PROFILE_CORE); // GL3 - success |= hasGL3; - if( hasGL3 ) { - resetStates(false); // clean this context states, since creation was temporary + if( !hasGL3 ) { + hasGL3 = createContextARBMapVersionsAvailable(3, CTX_PROFILE_CORE); // GL3 + success |= hasGL3; + if( hasGL3 ) { + resetStates(false); // clean this context states, since creation was temporary + } } } if( !hasGL4bc ) { diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index 5a9a30313..2edb22314 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -184,7 +184,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } } if( null != eglES2DynamicLookupHelper || null != eglES1DynamicLookupHelper ) { - if(isANGLE && !enableANGLE) { + if(isANGLE && !GLProfile.enableANGLE) { if(DEBUG || GLProfile.DEBUG) { System.err.println("Info: EGLDrawableFactory.init - EGL/ES2 ANGLE disabled"); } |