diff options
author | Sven Gothel <[email protected]> | 2019-07-08 05:10:02 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-07-08 05:10:02 +0200 |
commit | 0f97d9292cc7ff97f61f68b69c5a375cc023a5af (patch) | |
tree | 9e669aff05ec49482db63e0f5fe608e8744f153a /src/newt/classes | |
parent | d488ff097fc329a3185c6c64a8a6908e1f9f63d6 (diff) |
NEWT iOS: Support Multi-Touch Events, PixelScale, ..
Note: Two subsequent commit will add some required change in the
native UIWindow/UIView creation methods to actually make the NEWT view being displayed ;-)
The demo 'com.jogamp.opengl.demos.ios.Hello' demonstrated a standard NEWT application
running on iOS.
Previous NativeWindow wrap-around demo is preserved in 'com.jogamp.opengl.demos.ios.Hello1'.
Tested on ipad 11'inch arm64 and x86_64 simulation:
- Using GearsES2 demo
- PixelScale 1f, 2f and 0f - last two using max pixel scale
- Touch w/ GearsES2 works:
-- 1 finger rotate
-- 2 finger drag
-- 2 finger pinch-zoom gesture detection
Diffstat (limited to 'src/newt/classes')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java index 79c35c310..5469f74b1 100644 --- a/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/ios/WindowDriver.java @@ -617,6 +617,21 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl SurfaceScaleUtils.scale(y, getPixelScaleY()), button, rotationXYZ, rotationScale); } + public final void sendTouchScreenEvent(final short eventType, final int modifiers, + final int[] pActionIdx, final short[] pNames, + final int[] pTypesI, final int[] pX, final int[] pY, final float[] pPressure, final float maxPressure) { + final int pCount = pNames.length; + final MouseEvent.PointerType[] pTypes = new MouseEvent.PointerType[pCount]; + for(int i=0; i<pCount; i++) { + pTypes[i] = MouseEvent.PointerType.valueOf(pTypesI[i]); + } + for(int i=0; i<pActionIdx.length; i++) { + doPointerEvent(false /*enqueue*/, false /*wait*/, + pTypes, eventType, modifiers, pActionIdx[i], true /*normalPNames*/, pNames, + pX, pY, pPressure, maxPressure, new float[] { 0f, 0f, 0f} /*rotationXYZ*/, 1f/*rotationScale*/); + } + } + @Override public final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) { throw new InternalError("XXX: Adapt Java Code to Native Code Changes"); @@ -765,7 +780,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl } protected static native boolean initIDs0(); - private native long createView0(int x, int y, int w, int h); + private native long createView0(int x, int y, int w, int h, float reqPixelScale); private native long createWindow0(int x, int y, int w, int h, boolean fullscreen, int windowStyle, int backingStoreType, long view); /** Must be called on Main-Thread */ private native void initWindow0(long parentWindow, long window, int x, int y, int w, int h, float reqPixelScale, @@ -787,7 +802,6 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl private native void close0(long window); /** Must be called on Main-Thread */ private native void setTitle0(long window, String title); - private native long contentView0(long window); /** Must be called on Main-Thread */ private native void changeContentView0(long parentWindowOrView, long window, long view); /** Must be called on Main-Thread */ |