diff options
author | Sven Gothel <[email protected]> | 2011-11-09 00:31:34 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-11-09 00:31:34 +0100 |
commit | 7bc4c218b47033cb66f4eb5e707a86a0a4e60cff (patch) | |
tree | 1421a42878680a4a1e1772fa05114c50ac70edfb /src/newt | |
parent | 1055ce051fd7bd3c88724888cf8f46c75535a249 (diff) |
NativeWindow: Add accessor interfaces NativeSurfaceHolder and NativeWindowHolder
- NativeSurfaceHolder interface allows access to it's implementation's NativeSurface reference.
- NativeWindowHolder interface allows access to it's implementation's NativeWindow reference.
Implement or extend interface w/ these accessors whereever it seems fit:
- NEWT Window
- GLDrawable
These accessors allow lower layers to retrieve the NativeSurface/Window instance
w/o knowledge of the 'upper' frameworks, ie. NativeWindow/JOGL or JOGL/NEWT.
Commited in followups (due to mixed semantical changes in those files):
- JAWTWindow
- NewtCanvasAWT
- Some NEWT impl.
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index e9ac272c8..51a2aa73b 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -195,6 +195,10 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC return window.getRequestedCapabilities(); } + public NativeWindow getNativeWindow() { + return window; + } + public final Window getWindow() { return window; } @@ -676,8 +680,18 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer, FPSC // GLDrawable methods // + + /** + * {@inheritDoc} + * <p> + * Be aware that the returned NativeSurface may change. + * If this inner {@link GLDrawable} representation became realized (see {@link #isRealized()}) + * this {@link GLDrawable}'s {@link NativeSurface} instance is being returned. + * Otherwise this {@link Window} {@link NativeSurface}'s is being returned. + * </p> + */ public final NativeSurface getNativeSurface() { - return null!=drawable ? drawable.getNativeSurface() : null; + return null!=drawable ? drawable.getNativeSurface() : window.getNativeSurface(); } public final long getHandle() { |