summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/windows
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/jogamp/opengl/windows
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/jogamp/opengl/windows')
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java20
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java6
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java4
5 files changed, 20 insertions, 16 deletions
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
index 33980d663..6b21c81be 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -316,6 +316,8 @@ public class WindowsWGLContext extends GLContextImpl {
throw new GLException("Error making temp context current: 0x" + toHexString(temp_ctx) + ", werr: "+GDI.GetLastError());
}
if( !setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT, false /* strictMatch */, null == sharedContext /* withinGLVersionsMapping */) ) { // use GL_VERSION
+ WGL.wglMakeCurrent(0, 0); // release temp context
+ WGL.wglDeleteContext(temp_ctx);
throw new InternalError("setGLFunctionAvailability !strictMatch failed");
}
WGL.wglMakeCurrent(0, 0); // release temp context
@@ -368,7 +370,7 @@ public class WindowsWGLContext extends GLContextImpl {
// otherwise context of similar profile but different creation method may not be share-able.
WGL.wglMakeCurrent(0, 0);
WGL.wglDeleteContext(temp_ctx);
- throw new GLException(getThreadName()+": WindowsWGLContex.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: "+glCaps.getGLProfile()+", current: "+getGLVersion());
+ throw new GLException(getThreadName()+": WindowsWGLContex.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.1). Requested: "+glCaps.getGLProfile()+", current: "+getGLVersion());
}
if(DEBUG) {
System.err.println("WindowsWGLContext.createContext ARB not used, fall back to !ARB context "+getGLVersion());
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index c15fe0414..76e1e8776 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -275,7 +275,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean isValid() {
+ public final boolean isAvailable() {
return null != context;
}
@Override
@@ -287,7 +287,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
@Override
final public GLContextImpl getContext() { return context; }
@Override
- public GLRendererQuirks getRendererQuirks() {
+ public GLRendererQuirks getRendererQuirks(final GLProfile glp) {
return null != context ? context.getRendererQuirks() : null;
}
@@ -303,12 +303,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
sharedMap.clear();
}
@Override
- public SharedResourceRunner.Resource mapPut(final String connection, final SharedResourceRunner.Resource resource) {
- return sharedMap.put(connection, resource);
+ public SharedResourceRunner.Resource mapPut(final AbstractGraphicsDevice device, final SharedResourceRunner.Resource resource) {
+ return sharedMap.put(device.getConnection(), resource);
}
@Override
- public SharedResourceRunner.Resource mapGet(final String connection) {
- return sharedMap.get(connection);
+ public SharedResourceRunner.Resource mapGet(final AbstractGraphicsDevice device) {
+ return sharedMap.get(device.getConnection());
}
@Override
public Collection<SharedResourceRunner.Resource> mapValues() {
@@ -318,13 +318,13 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public boolean isDeviceSupported(final String connection) {
+ public boolean isDeviceSupported(final AbstractGraphicsDevice device) {
return true;
}
@Override
- public SharedResourceRunner.Resource createSharedResource(final String connection) {
- final WindowsGraphicsDevice sharedDevice = new WindowsGraphicsDevice(connection, AbstractGraphicsDevice.DEFAULT_UNIT);
+ public SharedResourceRunner.Resource createSharedResource(final AbstractGraphicsDevice device) {
+ final WindowsGraphicsDevice sharedDevice = new WindowsGraphicsDevice(device.getConnection(), device.getUnitID());
sharedDevice.lock();
try {
final AbstractGraphicsScreen absScreen = new DefaultGraphicsScreen(sharedDevice, 0);
@@ -367,7 +367,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
hasARBPixelFormat, hasARBMultisample,
hasARBPBuffer, hasARBReadDrawableAvailable);
} catch (final Throwable t) {
- throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources for "+connection, t);
+ throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources for "+device, t);
} finally {
sharedDevice.unlock();
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
index 2285ae996..d13e4ddad 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
@@ -28,8 +28,10 @@
package jogamp.opengl.windows.wgl;
-import jogamp.opengl.*;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import jogamp.opengl.DesktopGLDynamicLibraryBundleInfo;
public final class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLibraryBundleInfo {
protected WindowsWGLDynamicLibraryBundleInfo() {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index c29972fca..84b2ad719 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -509,7 +509,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
caps.getAccumGreenBits() > 0 ||
caps.getAccumBlueBits() > 0 ||
caps.getAccumAlphaBits() > 0 ) {
- final GLRendererQuirks sharedQuirks = sharedResource.getRendererQuirks();
+ final GLRendererQuirks sharedQuirks = sharedResource.getRendererQuirks(null);
if ( !usePBuffer || null==sharedQuirks || !sharedQuirks.exist(GLRendererQuirks.NoPBufferWithAccum) ) {
iattributes.put(niattribs++, WGLExt.WGL_ACCUM_BITS_ARB);
iattributes.put(niattribs++, ( caps.getAccumRedBits() +
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 5d2df4784..7c387827a 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -132,7 +132,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
List<GLCapabilitiesImmutable> availableCaps = null;
final GLContext sharedContext;
- if ( factory.hasRendererQuirk(device, GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries) ) {
+ if ( factory.hasRendererQuirk(device, null, GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries) ) {
sharedContext = sharedResource.getContext();
if(GLContext.CONTEXT_NOT_CURRENT == sharedContext.makeCurrent()) {
throw new GLException("Could not make Shared Context current: "+device);
@@ -300,7 +300,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
final AbstractGraphicsDevice device = config.getScreen().getDevice();
final WindowsWGLDrawableFactory.SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(device);
final GLContext sharedContext;
- if ( factory.hasRendererQuirk(device, GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries) ) {
+ if ( factory.hasRendererQuirk(device, null, GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries) ) {
sharedContext = sharedResource.getContext();
if(GLContext.CONTEXT_NOT_CURRENT == sharedContext.makeCurrent()) {
throw new GLException("Could not make Shared Context current: "+device);