diff options
author | Sven Gothel <[email protected]> | 2011-02-28 05:22:24 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-02-28 05:22:24 +0100 |
commit | 254052b54cebdb957d83e46e377534ef263d6029 (patch) | |
tree | 7ce8240d982303ed078d3fc8c59db5bba5b8ff6b /src/jogl/classes/jogamp | |
parent | 3ee26cd01789d0169c5225b3a4e5229e4a1c6676 (diff) |
JOGL GLDrawableFactory: Expose experimental method createProxySurface(..) for new windowing system ad-hoc development.
WARNING: This method may change ro be removed over time!
Diffstat (limited to 'src/jogl/classes/jogamp')
5 files changed, 46 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java index 585590170..e04ced6fa 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java @@ -232,6 +232,21 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { GLCapabilitiesChooser chooser, int width, int height); + public ProxySurface createProxySurface(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) { + if(null == device) { + throw new GLException("No shared device for requested: "+device); + } + + device.lock(); + try { + return createProxySurfaceImpl(device, windowHandle, capsRequested, chooser); + } finally { + device.unlock(); + } + } + + protected abstract ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser); + //--------------------------------------------------------------------------- // // External GLDrawable construction diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index f81e5a70e..b6599de1b 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -225,6 +225,11 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { return ns; } + protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) { + WrappedSurface ns = new WrappedSurface(EGLGraphicsConfigurationFactory.createOffscreenGraphicsConfiguration(device, capsRequested, capsRequested, chooser), windowHandle); + return ns; + } + protected GLContext createExternalGLContextImpl() { AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_EGL); return new EGLExternalContext(absScreen); diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index fa0a0b6ed..6ce793490 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -173,6 +173,12 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { return ns; } + protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) { + AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, 0); + WrappedSurface ns = new WrappedSurface(MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen, true), windowHandle); + return ns; + } + protected GLContext createExternalGLContextImpl() { return MacOSXExternalCGLContext.create(this, null); } diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index 5afbb9218..3cbef2569 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -65,6 +65,7 @@ import javax.media.opengl.GLProfile; import com.jogamp.common.JogampRuntimeException; import com.jogamp.common.nio.PointerBuffer; import com.jogamp.common.util.ReflectionUtil; +import javax.media.opengl.GLCapabilities; import jogamp.nativewindow.WrappedSurface; import jogamp.nativewindow.windows.GDI; import jogamp.nativewindow.windows.GDISurface; @@ -445,6 +446,15 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { return ns; } + protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice adevice, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) { + // FIXME device/windowHandle -> screen ?! + WindowsGraphicsDevice device = (WindowsGraphicsDevice) adevice; + AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, 0); + WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen); + GDISurface ns = new GDISurface(cfg, windowHandle); + return ns; + } + protected final GLContext createExternalGLContextImpl() { return WindowsExternalWGLContext.create(this, null); } diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index 755c078b9..8203a440c 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -177,6 +177,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { try { String glXVendorName = GLXUtil.getVendorName(sharedDevice.getHandle()); X11GraphicsScreen sharedScreen = new X11GraphicsScreen(sharedDevice, 0); + if (null == sharedScreen) { throw new GLException("Couldn't create shared screen for device: "+sharedDevice+", idx 0"); } @@ -407,6 +408,15 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { return ns; } + protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice adevice, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) { + // FIXME device/windowHandle -> screen ?! + X11GraphicsDevice device = (X11GraphicsDevice) adevice; + X11GraphicsScreen screen = new X11GraphicsScreen(device, 0); + X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen); + WrappedSurface ns = new WrappedSurface(cfg, windowHandle); + return ns; + } + protected final GLContext createExternalGLContextImpl() { return X11ExternalGLXContext.create(this, null); } |