diff options
author | Sven Gothel <[email protected]> | 2011-11-09 07:42:20 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-11-09 07:42:20 +0100 |
commit | 46542168d64b37f544f61802693f15b59b224e4e (patch) | |
tree | 292a62903a27ef00cef92faca19d323f914bce28 /src/jogl/classes/jogamp/opengl/macosx/cgl | |
parent | f51e3dad6c4bd1f6d0001cecf6a0f692400ed602 (diff) |
OS X Layered View: Part5 NEWT/AWT Interaction ; Fix NSOpenGLLayer pos ; Cleanup
Better JAWT* name for offscreen layer surface:
- MacOSXCGLDrawableFactory, JAWTUtil, JAWTWindow, MacOSXJAWTWindow
- FIXME: Need to get rid of the cached JAWT instance,
in case we like to have dual usage of offscreenLayerSurface and onscreen.
This would be done implicit by using NEWT .. hence low prio.
AWTGraphicsConfiguration:
- Fix create(): Use capsRequested for AWT aligned caps if capsChosen is null.
(was capsChosen .. which is null)
- Add updateGraphicsConfiguration() which allows to update the AWTGraphicsConfiguration.
NewtFactoryAWT:
- Add updateGraphicsConfiguration() .. entrypoint for AWTGraphicsConfiguration.updateGraphicsConfiguration()
NSOpenGLLayer Impl:
- For 'some reason' the layer's position is initially negative, fix it @ 1st 'draw'
- Re-add CVDisplayLink OpenGL setting .. for what it's worth .. I don't know
JAWTWindow:
- Remove test setting: Only enable offscreenLayerSurface for applets if avail.
(New unit test enables it seperatly)
NewtCanvasAWT:
- If NEWT child is offscreen, attach AWTMouseAdapter and AWTKeyAdapter
to route these AWT input events to NEWT.
- Don't loose-focus if NEWT child is offscreen.
- Impl. NativeSurfaceHolder, NativeWindowHolder
- NativeWindow is created at construction
and it's GraphicsConfiguration updated at addNotify(..).
- At addNotify/reparent: try harder to determine proper NEWT child size:
- use preferred size if set
- use minimum size if set
- subtract insets from container size
OffscreenWindow/WindowImpl:
- Allow setSize() .. currently NOP for offscreen.
- WindowImpl: Commented out recreate case for offscreen-setSize ..
TEST: com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01AWT
Passed tests:
- GLCanvas
- NewtCanvasAWT/OffscreenWindow
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/macosx/cgl')
3 files changed, 6 insertions, 9 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 4ab81e5ff..8e845e847 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -422,7 +422,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl System.err.println("NS create pixelFormat: "+toHexString(pixelFormat)); System.err.println("NS create drawable native-handle: "+toHexString(drawable.getHandle())); System.err.println("NS create drawable NSView-handle: "+toHexString(drawable.getNSViewHandle())); - Thread.dumpStack(); + // Thread.dumpStack(); } try { int[] viewNotReady = new int[1]; diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index 95401db83..e08461527 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -266,7 +266,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { if( nwThis instanceof MacOSXJAWTWindow) { // direct surface host, eg. via AWT GLCanvas final MacOSXJAWTWindow r = (MacOSXJAWTWindow) nwThis; - return r.isLayeredSurface() ? r : null; + return r.isOffscreenLayerSurface() ? r : null; } else { // parent surface host, eg. via native parenting w/ NewtCanvasAWT NativeWindow nwParent = nwThis.getParent(); @@ -276,7 +276,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } if(null != nwParent && nwParent instanceof MacOSXJAWTWindow) { final MacOSXJAWTWindow r = (MacOSXJAWTWindow) nwParent; - return r.isLayeredSurface() ? r : null; + return r.isOffscreenLayerSurface() ? r : null; } } } diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java index c29a5f9b5..5c4c3907c 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java @@ -51,14 +51,10 @@ import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLException; import javax.media.opengl.GLProfile; -import jogamp.opengl.Debug; - import com.jogamp.common.nio.PointerBuffer; import com.jogamp.opengl.util.GLBuffers; -public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { - private static final boolean DEBUG = Debug.debug("MacOSXPbufferCGLDrawable"); - +public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { // Abstract interface for implementation of this drawable (either // NSOpenGL-based or CGL-based) interface GLBackendImpl { @@ -171,9 +167,10 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable { pBuffer = impl.create(pBufferTexTarget, internalFormat, getWidth(), getHeight()); if(DEBUG) { System.err.println("MacOSXPbufferCGLDrawable tex: target "+toHexString(pBufferTexTarget)+ - ", size "+toHexString(pBufferTexWidth)+"x"+toHexString(pBufferTexHeight)+ + ", size "+pBufferTexWidth+"x"+pBufferTexHeight+ ", internal-fmt "+toHexString(internalFormat)); System.err.println("MacOSXPbufferCGLDrawable pBuffer: "+toHexString(pBuffer)); + // Thread.dumpStack(); } if (pBuffer == 0) { throw new GLException("pbuffer creation error: CGL.createPBuffer() failed"); |