diff options
author | Sven Gothel <[email protected]> | 2012-02-25 19:21:43 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-02-25 19:21:43 +0100 |
commit | aee3a75ad87ef3da0652c6b917ccdfda63a1230d (patch) | |
tree | 087637968ca3e1a6bf81a92e7dfaaef2cceb9ada /src/nativewindow/classes | |
parent | 9db2d90e5398e7b2abe45f0799a9d00729575b49 (diff) |
X11: Fix unavailable GLX (Server): Use fallback GraphicsConfigurationFactory (X11GLX -> X11)
- GraphicsConfigurationFactory.registerFactory(..) returns previous mapped GraphicsConfigurationFactory.
This allows daisy chaining of GraphicsConfigurationFactory, in case one is not suitable.
- X11GLXGraphicsConfigurationFactory:
- Store the previously mapped factory as fallback
- choose*Impl(): If GLX is not available, use fallback
Diffstat (limited to 'src/nativewindow/classes')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java index 259644467..8570794d8 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java @@ -154,18 +154,21 @@ public abstract class GraphicsConfigurationFactory { * called by end users, only implementors of new * GraphicsConfigurationFactory subclasses. * + * @return the previous registered factory, or null if none * @throws IllegalArgumentException if the given class does not implement AbstractGraphicsDevice */ - protected static void registerFactory(Class<?> abstractGraphicsDeviceImplementor, GraphicsConfigurationFactory factory) + protected static GraphicsConfigurationFactory registerFactory(Class<?> abstractGraphicsDeviceImplementor, GraphicsConfigurationFactory factory) throws IllegalArgumentException { if (!(abstractGraphicsDeviceClass.isAssignableFrom(abstractGraphicsDeviceImplementor))) { throw new IllegalArgumentException("Given class must implement AbstractGraphicsDevice"); } + GraphicsConfigurationFactory prevFactory = registeredFactories.put(abstractGraphicsDeviceImplementor, factory); if(DEBUG) { - System.err.println("GraphicsConfigurationFactory.registerFactory() "+abstractGraphicsDeviceImplementor+" -> "+factory); + System.err.println("GraphicsConfigurationFactory.registerFactory() "+abstractGraphicsDeviceImplementor+" -> "+factory+ + ", overridding: "+prevFactory); } - registeredFactories.put(abstractGraphicsDeviceImplementor, factory); + return prevFactory; } /** |