summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLContext.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-12-07 04:03:02 +0100
committerSven Gothel <[email protected]>2014-12-07 04:03:02 +0100
commit35622a7cef4a28ce7e32bf008ef331d9a0d9e3e2 (patch)
treee688b4fcb141c0b6b026d20379fb0ba6dd60a256 /src/jogl/classes/javax/media/opengl/GLContext.java
parent9ea218a5990b908e04235c407c0951c60df6ffba (diff)
Bug 1068 - Allow GLContext creation and makeCurrent without default framebuffer (Part 2); Bug 896: EGL_KHR_create_context (Part 1)
Bug 1068 - Allow GLContext creation and makeCurrent without default framebuffer (Part 2) Implement surfaceless context on EGL and GLX/X11 utilizing *UpstreamSurfacelessHook as introduced in commit 9ea218a5990b908e04235c407c0951c60df6ffba. Surfaceless context is probed during GL profile probing by default. If available, it will be used for offscreen FBO drawables. If probing fails, or is disabled, the new GLRendererQuirks.NoSurfacelessCtx is set. - GLProfile.disableSurfacelessContext disables surfaceless context probing, set property 'jogl.disable.surfacelesscontext' Tested: - Mesa/EGL works, - Mesa + NVidia w/ GLX fail on GNU/Linux): Fails NoSurfacelessCtx - TODO: Windows impl. and more tests +++ Bug 896: EGL_KHR_create_context (Part 1) - Detect EGL_KHR_create_context capability and utilize if available. - Implement EGLContext.createContextARBImpl(..), allowing native DEBUG context usage, where available. - EGL implements SharedResourceRunner, i.e. probing profiles on dedicated thread using common interface. - Probe desktop profile/context ability in EGLDrawableFactory SharedResourceRunner, Where EGLGLnDynamicLibraryBundleInfo covers EGL + desktop GL. - TODO: Tests w/ capable implementation
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLContext.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 503280e74..01e0e8270 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -333,10 +333,11 @@ public abstract class GLContext {
* if the {@link #getGLReadDrawable() read-drawable} differs
* from the {@link #getGLDrawable() write-drawable}.
* Otherwise set both drawables, read and write.
- * @return The previous read/write drawable
+ * @return The previous read/write drawable if operation succeeds
*
- * @throws GLException in case <code>null</code> is being passed or
- * this context is made current on another thread.
+ * @throws GLException in case <code>null</code> 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);