diff options
author | Kenneth Russel <[email protected]> | 2008-06-27 00:00:33 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-06-27 00:00:33 +0000 |
commit | 1f64245f42db1bf5b5ff63ff4425b4dfd9e1b70d (patch) | |
tree | 349c70f041075dc6fb7d24d66a66e07119f2b2e6 /src/classes/javax/media | |
parent | ef077b7abd6b54308071c48d1081cae8902f6dec (diff) |
Mac OS X port of new JOGL and Newt. Currently leverages the AWT; will
re-host Newt on lower level code when a port to an AWT-less Mac OS
X-based mobile device is done. Added support to NativeWindow and Newt
for wrapping a Java-based window from a toolkit like the AWT, and
added appropriate code to the GLDrawableFactory implementations to
recognize and handle these NativeWindows. Fixed naming of native
method for JAWT_DrawingSurfaceInfo.platformInfo0(). Fixed linker
definition on Mac and cleaned up Windows variants. Fixed intptr_t
definitions in ES1 and ES2 native code. Added workaround for GLU type
reference in com.sun.opengl.util.texture.Texture. Fixed bugs in Newt
event dispatching. Tested with RedSquare demo on Mac OS X.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1698 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media')
-rw-r--r-- | src/classes/javax/media/opengl/GLDrawableFactory.java | 9 | ||||
-rw-r--r-- | src/classes/javax/media/opengl/NativeWindow.java | 22 |
2 files changed, 21 insertions, 10 deletions
diff --git a/src/classes/javax/media/opengl/GLDrawableFactory.java b/src/classes/javax/media/opengl/GLDrawableFactory.java index 2a8b32356..2e6e2ccac 100644 --- a/src/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/classes/javax/media/opengl/GLDrawableFactory.java @@ -191,10 +191,15 @@ public abstract class GLDrawableFactory { public static GLDrawableFactory getFactory(Object target) throws GLException { - if(null==target) { + if (target == null) { throw new IllegalArgumentException("target is null"); } - if(target instanceof NativeWindow) { + if (target instanceof NativeWindow) { + if (((NativeWindow) target).getWrappedWindow() != null) { + target = ((NativeWindow) target).getWrappedWindow(); + } + } + if (target instanceof NativeWindow) { return getFactory(false); } else if (NativeWindowFactory.isAWTComponent(target)) { return getFactory(true); diff --git a/src/classes/javax/media/opengl/NativeWindow.java b/src/classes/javax/media/opengl/NativeWindow.java index 56562a4c9..1ab7c7c7a 100644 --- a/src/classes/javax/media/opengl/NativeWindow.java +++ b/src/classes/javax/media/opengl/NativeWindow.java @@ -69,27 +69,27 @@ public interface NativeWindow { public long getScreenHandle(); /** - * Returns the window handle for this NativeWindow. + * Returns the window handle for this NativeWindow. <P> * * The window handle shall reflect the platform one - * for all window related operations, e.g. open, close, resize. + * for all window related operations, e.g. open, close, resize. <P> * - * On X11 this returns an entity of type Window. + * On X11 this returns an entity of type Window. <BR> * On Microsoft Windows this returns an entity of type HWND. */ - public long getWindowHandle() throws NativeWindowException; + public long getWindowHandle(); /** - * Returns the handle to the surface for this NativeWindow. + * Returns the handle to the surface for this NativeWindow. <P> * * The surface handle shall reflect the platform one - * for all drawable surface operations, e.g. opengl, swap-buffer. + * for all drawable surface operations, e.g. opengl, swap-buffer. <P> * * On X11 this returns an entity of type Window, - * since there is no differentiation of surface and window there. + * since there is no differentiation of surface and window there. <BR> * On Microsoft Windows this returns an entity of type HDC. */ - public long getSurfaceHandle() throws NativeWindowException; + public long getSurfaceHandle(); /** * Lifetime: after 1st lock, until invalidation @@ -97,6 +97,12 @@ public interface NativeWindow { public long getVisualID(); public int getScreenIndex(); + /** + * If this NativeWindow actually wraps a window from a Java-level + * window toolkit like the AWT, returns the underlying window. + */ + public Object getWrappedWindow(); + public void setSize(int width, int height); public void setPosition(int x, int y); public int getWidth(); |