aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-04-13 21:24:44 +0200
committerSven Gothel <[email protected]>2010-04-13 21:24:44 +0200
commit2df3bea10859ee2f2c4b3622f3b610b17a5749d6 (patch)
tree9bb948241aef06fdaf1dd4d09f1b31989c76f858 /src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java
parent1c1053c6a8b669c067ae1316b9770871e213ea05 (diff)
ATI (fglrx) PBuffer/X11Display bug workaround/cleanup
- See https://bugzilla.mozilla.org/show_bug.cgi?id=486277 - Description: - To use PBuffer, a context must be current - X11Display cannot be switched while using the PBuffer [within one thread]. Hence we shall try harder to reuse _the_ user configured X11Display - whenever possible. This is actually a good thing, ie cleanup up our code again. - Changes to workaround/cleanup: - GLDrawableFactory* methods 'canCreate*()' are changed to 'canCreate*(AbstractGraphicsDevice)' to allow pipelining the X11Display. This reduces the overhead of using a local TLS X11Display. - WindowsDummyWGLDrawable cstr gets the GLProfile as a parameter now, this is done while adding X11DummyGLXDrawable - forseeing the usecase to query available GLProfiles at startup. - X11DummyGLXDrawable added, following the WindowsDummyWGLDrawable path to have a dummy GLContext current to fix the ATI bug. NativeWindow X11: - Add XIOErrorHandler to identify the fatal failure of closing a Display (-> ATI bug). Build: - Adding ant.jar and ant-junit.jar to the junit compile/run classpath - Misc: - Fix: CreateDummyWindow(..) returns a HWND, not a HDC - mapToRealGLFunctionName: Added mapping for X11/GLX. - X11GLXGraphicsConfigurationFactory: Uncommented dead code 'createDefaultGraphicsConfigurationFBConfig' Tests: Passed (Linux64bit: NVidia/ATI) Todo: More tests on ATI, especially multithreading/X11Display usage.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java
index c8faf0f65..35810678c 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java
@@ -54,6 +54,9 @@ import java.lang.reflect.*;
public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
protected static final boolean DEBUG = Debug.debug("GLDrawableFactory");
+ public void shutdown() {
+ }
+
//---------------------------------------------------------------------------
// Dispatching GLDrawable construction in respect to the NativeWindow Capabilities
//
@@ -76,7 +79,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
if( ! ( target instanceof SurfaceChangeable ) ) {
throw new IllegalArgumentException("Passed NativeWindow must implement SurfaceChangeable for offscreen: "+target);
}
- if(caps.isPBuffer() && canCreateGLPbuffer()) {
+ if(caps.isPBuffer()) {
if(DEBUG) {
System.out.println("GLDrawableFactoryImpl.createGLDrawable -> PbufferDrawable: "+target);
}
@@ -111,7 +114,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
protected abstract GLDrawableImpl createGLPbufferDrawableImpl(NativeWindow target);
protected GLDrawableImpl createGLPbufferDrawable(NativeWindow target) {
- if (!canCreateGLPbuffer()) {
+ if (!canCreateGLPbuffer(target.getGraphicsConfiguration().getNativeGraphicsConfiguration().getScreen().getDevice())) {
throw new GLException("Pbuffer support not available with current graphics card");
}
return createGLPbufferDrawableImpl(target);
@@ -215,7 +218,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
// implement this functionality on all other platforms
//
- public abstract boolean canCreateContextOnJava2DSurface();
+ public abstract boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device);
public abstract GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
throws GLException;
@@ -312,7 +315,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
throw new IllegalArgumentException("Should not call this unless setDisplayGamma called first");
}
resetGammaRamp(originalGammaRamp);
- unregisterGammeShutdownHook();
+ unregisterGammaShutdownHook();
}
//------------------------------------------------------
@@ -364,7 +367,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
gammaShutdownHookRegistered = true;
}
- private synchronized void unregisterGammeShutdownHook() {
+ private synchronized void unregisterGammaShutdownHook() {
if (!gammaShutdownHookRegistered)
return;
if (gammaShutdownHook == null) {