From 35622a7cef4a28ce7e32bf008ef331d9a0d9e3e2 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Sun, 7 Dec 2014 04:03:02 +0100
Subject: 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
---
src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
(limited to 'src/jogl/classes/javax/media/opengl/GLDrawableFactory.java')
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 {
*
*
* @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}
* @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
--
cgit v1.2.3