From 35622a7cef4a28ce7e32bf008ef331d9a0d9e3e2 Mon Sep 17 00:00:00 2001
From: Sven Gothel null
is being passed or
- * this context is made current on another thread.
+ * @throws GLException in case null
is being passed,
+ * this context is made current on another thread
+ * or operation fails.
*
* @see #isGLReadDrawableAvailable()
* @see #setGLReadDrawable(GLDrawable)
@@ -1473,13 +1474,13 @@ public abstract class GLContext {
/* 1.*/ { 0, 1, 2, 3, 4, 5 },
/* 2.*/ { 0, 1 },
/* 3.*/ { 0, 1, 2, 3 },
- /* 4.*/ { 0, 1, 2, 3, 4 } };
+ /* 4.*/ { 0, 1, 2, 3, 4, 5 } };
public static final int ES_VERSIONS[][] = {
/* 0.*/ { -1 },
/* 1.*/ { 0, 1 },
/* 2.*/ { 0 },
- /* 3.*/ { 0 } };
+ /* 3.*/ { 0, 1 } };
public static final int getMaxMajor(final int ctxProfile) {
return ( 0 != ( CTX_PROFILE_ES & ctxProfile ) ) ? ES_VERSIONS.length-1 : GL_VERSIONS.length-1;
@@ -1638,11 +1639,15 @@ public abstract class GLContext {
}
}
- protected static void setAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
+ protected static void setAvailableGLVersionsSet(final AbstractGraphicsDevice device, final boolean set) {
synchronized ( deviceVersionsAvailableSet ) {
final String devKey = device.getUniqueID();
- if( null != deviceVersionsAvailableSet.put(devKey, devKey) ) {
- throw new InternalError("Already set: "+devKey);
+ if( set ) {
+ if( null != deviceVersionsAvailableSet.put(devKey, devKey) ) {
+ throw new InternalError("Already set: "+devKey);
+ }
+ } else {
+ deviceVersionsAvailableSet.remove(devKey);
}
if (DEBUG) {
System.err.println(getThreadName() + ": createContextARB: SET mappedVersionsAvailableSet "+devKey);
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 71568ee76..dabd3531b 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -144,7 +144,7 @@ public abstract class GLDrawableFactory {
}
}
}
- if (null != factoryClassName) {
+ if (null != factoryClassName && !GLProfile.disableOpenGLDesktop) {
if (DEBUG || GLProfile.DEBUG) {
System.err.println("GLDrawableFactory.static - Native OS Factory for: "+nwt+": "+factoryClassName);
}
@@ -387,13 +387,14 @@ public abstract class GLDrawableFactory {
*
null
for the platform's default device.
+ * @param glp {@link GLProfile} to identify the device's {@link GLRendererQuirks}, maybe {@code null}
* @param quirk the quirk to be tested, e.g. {@link GLRendererQuirks#NoDoubleBufferedPBuffer}.
* @throws IllegalArgumentException if the quirk is out of range
- * @see #getRendererQuirks(AbstractGraphicsDevice)
+ * @see #getRendererQuirks(AbstractGraphicsDevice, GLProfile)
* @see GLRendererQuirks
*/
- public final boolean hasRendererQuirk(final AbstractGraphicsDevice device, final int quirk) {
- final GLRendererQuirks glrq = getRendererQuirks(device);
+ public final boolean hasRendererQuirk(final AbstractGraphicsDevice device, final GLProfile glp, final int quirk) {
+ final GLRendererQuirks glrq = getRendererQuirks(device, glp);
return null != glrq ? glrq.exist(quirk) : false;
}
@@ -407,10 +408,11 @@ public abstract class GLDrawableFactory {
* the result is always null
.
*
* @param device which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be null
for the platform's default device.
+ * @param glp {@link GLProfile} to identify the device's {@link GLRendererQuirks}, maybe {@code null}
* @see GLContext#getRendererQuirks()
* @see GLRendererQuirks
*/
- public abstract GLRendererQuirks getRendererQuirks(AbstractGraphicsDevice device);
+ public abstract GLRendererQuirks getRendererQuirks(AbstractGraphicsDevice device, final GLProfile glp);
/**
* Returns the sole GLDrawableFactory instance for the desktop (X11, WGL, ..) if exist or null
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index c1ca9a48b..7f29bb7dc 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -53,6 +53,7 @@ import com.jogamp.common.util.locks.LockFactory;
import com.jogamp.common.util.locks.RecursiveThreadGroupLock;
import com.jogamp.gluegen.runtime.FunctionAddressResolver;
import com.jogamp.nativewindow.NativeWindowVersion;
+import com.jogamp.opengl.GLRendererQuirks;
import com.jogamp.opengl.JoglVersion;
import javax.media.nativewindow.AbstractGraphicsDevice;
@@ -79,13 +80,6 @@ public class GLProfile {
public static final boolean DEBUG;
- /**
- * In case no OpenGL ES profiles are required
- * 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;
-
/**
* In case no native OpenGL core profiles are required
* and if one platform may have a buggy implementation,
@@ -101,11 +95,42 @@ public class GLProfile {
* context creation extension is buggy on one platform,
* setting the property jogl.disable.openglarbcontext
disables utilizing it.
* + * This exclusion also disables {@link #disableOpenGLES OpenGL ES}. + *
+ ** This exclusion is disabled for {@link Platform.OSType#MACOS}. *
*/ public static final boolean disableOpenGLARBContext; + /** + * In case no OpenGL ES profiles are required + * and if one platform may have a buggy implementation, + * setting the propertyjogl.disable.opengles
disables querying possible existing OpenGL ES profiles.
+ */
+ public static final boolean disableOpenGLES;
+
+ /**
+ * In case no OpenGL desktop profiles are required
+ * and if one platform may have a buggy implementation,
+ * setting the property jogl.disable.opengldesktop
disables querying possible existing OpenGL desktop profiles.
+ */
+ public static final boolean disableOpenGLDesktop;
+
+ /**
+ * Disable surfaceless OpenGL context capability and its probing
+ * by setting the property jogl.disable.surfacelesscontext
.
+ * + * By default surfaceless OpenGL context capability is probed, + * i.e. whether an OpenGL context can be made current without a default framebuffer. + *
+ *+ * If probing fails or if this property is set, the {@link GLRendererQuirks quirk} {@link GLRendererQuirks#NoSurfacelessCtx} + * is being set. + *
+ */ + public static final boolean disableSurfacelessContext; + /** * 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. @@ -122,9 +147,11 @@ public class GLProfile { 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; + disableOpenGLES = disableOpenGLARBContext || PropertyAccess.isPropertyDefined("jogl.disable.opengles", true); + disableOpenGLDesktop = PropertyAccess.isPropertyDefined("jogl.disable.opengldesktop", true); + disableSurfacelessContext = PropertyAccess.isPropertyDefined("jogl.disable.surfacelesscontext", true); enableANGLE = PropertyAccess.isPropertyDefined("jogl.enable.ANGLE", true); } @@ -1895,7 +1922,7 @@ public class GLProfile { // also test GLES1, GLES2 and GLES3 on desktop, since we have implementations / emulations available. if( deviceIsEGLCompatible && ( hasGLES3Impl || hasGLES1Impl ) ) { // 1st pretend we have all EGL profiles .. - computeProfileMap(device, false /* desktopCtxUndef*/, true /* esCtxUndef */); + computeProfileMap(device, true /* desktopCtxUndef*/, true /* esCtxUndef */); // Triggers eager initialization of share context in GLDrawableFactory for the device, // hence querying all available GLProfiles @@ -1935,7 +1962,7 @@ public class GLProfile { } if(!GLContext.getAvailableGLVersionsSet(device)) { - GLContext.setAvailableGLVersionsSet(device); + GLContext.setAvailableGLVersionsSet(device, true); } if (DEBUG) { -- cgit v1.2.3