diff options
author | Sven Gothel <[email protected]> | 2008-11-26 22:05:16 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-11-26 22:05:16 +0000 |
commit | 47c0b60fa9fdd1df48cad1ec999ba40c3185e28f (patch) | |
tree | ead27b319ac5a8cf5a839e8c654b71c69d3efada /src/classes/com/sun/javafx/newt/kd | |
parent | 3fac9daea59c6231f96ef162e6ea64ff35e0b958 (diff) |
Newt-KD: window working, pointer event buggy
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1806 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/javafx/newt/kd')
-rwxr-xr-x | src/classes/com/sun/javafx/newt/kd/KDWindow.java | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/classes/com/sun/javafx/newt/kd/KDWindow.java b/src/classes/com/sun/javafx/newt/kd/KDWindow.java index 7cc4724bc..3ac502111 100755 --- a/src/classes/com/sun/javafx/newt/kd/KDWindow.java +++ b/src/classes/com/sun/javafx/newt/kd/KDWindow.java @@ -78,16 +78,17 @@ public class KDWindow extends Window { visualID = config.getNativeConfigID(); chosenCaps = config.getCapabilities(); - windowHandle = CreateWindow(getDisplayHandle(), visualID, eglRenderableType); - if (windowHandle == 0) { - throw new RuntimeException("Error creating window: "+windowHandle); + windowHandle = 0; + eglWindowHandle = CreateWindow(getDisplayHandle(), visualID, eglRenderableType); + if (eglWindowHandle == 0) { + throw new RuntimeException("Error creating egl window: "+eglWindowHandle); } - nativeWindowHandle = RealizeWindow(windowHandle); - if (nativeWindowHandle == 0) { + setVisible0(eglWindowHandle, false); + windowHandle = RealizeWindow(eglWindowHandle); + if (0 == windowHandle) { throw new RuntimeException("Error native Window Handle is null"); } - - windowHandleClose = windowHandle; + windowHandleClose = eglWindowHandle; } protected void closeNative() { @@ -99,13 +100,13 @@ public class KDWindow extends Window { public void setVisible(boolean visible) { if(this.visible!=visible) { this.visible=visible; - setVisible0(windowHandle, visible); + setVisible0(eglWindowHandle, visible); clearEventMask(); } } public void setSize(int width, int height) { - setSize0(windowHandle, width, height); + setSize0(eglWindowHandle, width, height); } public void setPosition(int x, int y) { @@ -117,10 +118,10 @@ public class KDWindow extends Window { if(this.fullscreen!=fullscreen) { this.fullscreen=fullscreen; if(this.fullscreen) { - setFullScreen0(windowHandle, true); + setFullScreen0(eglWindowHandle, true); } else { - setFullScreen0(windowHandle, false); - setSize0(windowHandle, nfs_width, nfs_height); + setFullScreen0(eglWindowHandle, false); + setSize0(eglWindowHandle, nfs_width, nfs_height); } } return true; @@ -135,7 +136,7 @@ public class KDWindow extends Window { } protected void dispatchMessages(int eventMask) { - DispatchMessages(windowHandle, eventMask); + DispatchMessages(eglWindowHandle, eventMask); } //---------------------------------------------------------------------- @@ -144,12 +145,12 @@ public class KDWindow extends Window { private static native boolean initIDs(); private native long CreateWindow(long displayHandle, long eglConfig, int eglRenderableType); - private native long RealizeWindow(long windowHandle); - private native int CloseWindow(long windowHandle); - private native void setVisible0(long windowHandle, boolean visible); - private native void setSize0(long windowHandle, int width, int height); - private native void setFullScreen0(long windowHandle, boolean fullscreen); - private native void DispatchMessages(long windowHandle, int eventMask); + private native long RealizeWindow(long eglWindowHandle); + private native int CloseWindow(long eglWindowHandle); + private native void setVisible0(long eglWindowHandle, boolean visible); + private native void setSize0(long eglWindowHandle, int width, int height); + private native void setFullScreen0(long eglWindowHandle, boolean fullscreen); + private native void DispatchMessages(long eglWindowHandle, int eventMask); private void sizeChanged(int newWidth, int newHeight) { width = newWidth; @@ -167,6 +168,6 @@ public class KDWindow extends Window { private void windowClosed() { } - private long nativeWindowHandle; // THE KD underlying native window handle + private long eglWindowHandle; private long windowHandleClose; } |