diff options
author | Sven Gothel <[email protected]> | 2012-05-01 03:19:57 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-05-01 03:19:57 +0200 |
commit | cc93cf413a59532bb31a4768c9d268234b859858 (patch) | |
tree | d31738ef66de312806e58ce41c8cc0539280c48c /src/jogl | |
parent | 8b0aa0e7653f74e713880e77f9afbe59caff38f0 (diff) |
EGLGraphicsConfigurationFactory: Add 'unregisterFactory()' static entry allowing to remove EGL/ES based factory
Diffstat (limited to 'src/jogl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java index 9d2973f05..904110eb2 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java @@ -73,6 +73,7 @@ import java.nio.IntBuffer; public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFactory { static VisualIDHolder.VIDComparator EglCfgIDComparator = new VisualIDHolder.VIDComparator(VisualIDHolder.VIDType.EGL_CONFIG); static GraphicsConfigurationFactory nativeGraphicsConfigurationFactory = null; + static GraphicsConfigurationFactory kdeglGraphicsConfigurationFactory = null; static void registerFactory() { GraphicsConfigurationFactory eglFactory = new EGLGraphicsConfigurationFactory(); @@ -87,7 +88,21 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact } */ // become the selector for KD/EGL .. - GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, eglFactory); + kdeglGraphicsConfigurationFactory = GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, eglFactory); + } + + static void unregisterFactory() { + final String nwType = NativeWindowFactory.getNativeWindowType(false); + if(NativeWindowFactory.TYPE_X11 == nwType) { + GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, nativeGraphicsConfigurationFactory); + } /* else if(NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false)) { + GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, nativeGraphicsConfigurationFactory); + } else if(NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) { + } */ + nativeGraphicsConfigurationFactory = null; + + GraphicsConfigurationFactory.registerFactory(com.jogamp.nativewindow.egl.EGLGraphicsDevice.class, kdeglGraphicsConfigurationFactory); + kdeglGraphicsConfigurationFactory = null; } private EGLGraphicsConfigurationFactory() { |