diff options
author | Sven Gothel <[email protected]> | 2011-02-22 07:40:23 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-02-22 07:40:23 +0100 |
commit | bb3d3743b4800d006457c767a00436b9308da75d (patch) | |
tree | fd687329fbcb7a53eab9aa1d9735f9eac7c6d22e /src/jogl/classes/jogamp/opengl/x11 | |
parent | bff7e97c2f22673bb0457765696fb867d3e4f69d (diff) |
NativeWindow ProxySurface Abstraction and lock/unlock Surface cleanup
- ProxySurface -> abstract javax.media.nativewindow.ProxySurface,
implemented by
jogamp.nativewindow.WrappedSurface, just wrapping surface handle
jogamp.nativewindow.windows.GDISurface, using HWND and get/release HDC on lock/unlock
- Unifying NativeSurface's lockSurface/unlockSurface implementations
- NEWT's WindowImpl
- NativeWindow's ProxySurface, WrappedWindow, GDIWindow and JAWTWindow
- wingdi/GDI: Add 'WindowFromDC' and 'GetClientRect' to GDI
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11')
4 files changed, 8 insertions, 12 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java index 202bba9e7..68bdb4ab8 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11DummyGLXDrawable.java @@ -45,11 +45,11 @@ public class X11DummyGLXDrawable extends X11OnscreenGLXDrawable { */ public X11DummyGLXDrawable(X11GraphicsScreen screen, GLDrawableFactory factory, GLCapabilitiesImmutable caps) { super(factory, - new ProxySurface(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic( + new WrappedSurface(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic( caps, caps, null, screen))); this.realized = true; - ProxySurface ns = (ProxySurface) getNativeSurface(); + WrappedSurface ns = (WrappedSurface) getNativeSurface(); X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)ns.getGraphicsConfiguration().getNativeGraphicsConfiguration(); X11GraphicsDevice device = (X11GraphicsDevice) screen.getDevice(); diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java index 769d5f1da..c488fe5cf 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java @@ -44,10 +44,9 @@ import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import javax.media.opengl.*; import jogamp.opengl.*; -import jogamp.nativewindow.ProxySurface; +import jogamp.nativewindow.WrappedSurface; public class X11ExternalGLXContext extends X11GLXContext { - private boolean firstMakeCurrent = true; private GLContext lastContext; private X11ExternalGLXContext(Drawable drawable, long ctx) { @@ -78,7 +77,7 @@ public class X11ExternalGLXContext extends X11GLXContext { GLX.glXQueryContext(display, ctx, GLX.GLX_FBCONFIG_ID, val, 0); X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val[0]); - ProxySurface ns = new ProxySurface(cfg); + WrappedSurface ns = new WrappedSurface(cfg); ns.setSurfaceHandle(drawable); return new X11ExternalGLXContext(new Drawable(factory, ns), ctx); } @@ -105,9 +104,6 @@ public class X11ExternalGLXContext extends X11GLXContext { } protected void makeCurrentImpl(boolean newCreated) throws GLException { - if (firstMakeCurrent) { - firstMakeCurrent = false; - } } protected void releaseImpl() throws GLException { diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java index 014992b88..eb286cdf0 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java @@ -42,7 +42,7 @@ package jogamp.opengl.x11.glx; import javax.media.nativewindow.*; import javax.media.nativewindow.x11.*; import javax.media.opengl.*; -import jogamp.nativewindow.ProxySurface; +import jogamp.nativewindow.WrappedSurface; public class X11ExternalGLXDrawable extends X11GLXDrawable { @@ -83,7 +83,7 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable { System.err.println("X11ExternalGLXDrawable: WARNING: forcing GLX_RGBA_TYPE for newly created contexts (current 0x"+Integer.toHexString(val[0])+")"); } } - ProxySurface ns = new ProxySurface(cfg); + WrappedSurface ns = new WrappedSurface(cfg); ns.setSurfaceHandle(drawable); ns.setSize(w, h); return new X11ExternalGLXDrawable(factory, ns); diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index 44ade1513..755c078b9 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -49,7 +49,7 @@ import javax.media.opengl.*; import jogamp.opengl.*; import com.jogamp.common.JogampRuntimeException; import com.jogamp.common.util.*; -import jogamp.nativewindow.ProxySurface; +import jogamp.nativewindow.WrappedSurface; import jogamp.nativewindow.x11.*; public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { @@ -399,7 +399,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { return null; } - ProxySurface ns = new ProxySurface( + WrappedSurface ns = new WrappedSurface( X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsChosen, capsRequested, chooser, screen) ); if(ns != null) { ns.setSize(width, height); |