• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révisiona2db6bc692c1b0ac069851bcb81b4a0ecda86384 (tree)
l'heure2021-09-27 21:27:11
AuteurHotshot5000 <sebastian_bugiu@yaho...>
CommiterHotshot5000

Message de Log

Added continuous and transient vibration support

Change Summary

Modification

--- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGraphics.java
+++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGraphics.java
@@ -750,6 +750,16 @@ public class AndroidGraphics extends AbstractGraphics implements Renderer {
750750 public void setSystemCursor (SystemCursor systemCursor) {
751751 }
752752
753+ @Override
754+ public long getViewHandle() {
755+ return 0;
756+ }
757+
758+ @Override
759+ public long getViewControllerHandle() {
760+ return 0;
761+ }
762+
753763 private class AndroidDisplayMode extends DisplayMode {
754764 protected AndroidDisplayMode (int width, int height, int refreshRate, int bitsPerPixel) {
755765 super(width, height, refreshRate, bitsPerPixel);
--- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java
+++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/DefaultAndroidInput.java
@@ -661,6 +661,26 @@ public class DefaultAndroidInput extends AbstractInput implements AndroidInput {
661661 }
662662
663663 @Override
664+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
665+
666+ }
667+
668+ @Override
669+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
670+
671+ }
672+
673+ @Override
674+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
675+
676+ }
677+
678+ @Override
679+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
680+
681+ }
682+
683+ @Override
664684 public boolean justTouched () {
665685 return justTouched;
666686 }
--- a/backends/gdx-backend-headless/src/com/badlogic/gdx/backends/headless/mock/graphics/MockGraphics.java
+++ b/backends/gdx-backend-headless/src/com/badlogic/gdx/backends/headless/mock/graphics/MockGraphics.java
@@ -256,6 +256,16 @@ public class MockGraphics extends AbstractGraphics {
256256 }
257257
258258 @Override
259+ public long getViewHandle() {
260+ return 0;
261+ }
262+
263+ @Override
264+ public long getViewControllerHandle() {
265+ return 0;
266+ }
267+
268+ @Override
259269 public Monitor getPrimaryMonitor() {
260270 return null;
261271 }
--- a/backends/gdx-backend-headless/src/com/badlogic/gdx/backends/headless/mock/input/MockInput.java
+++ b/backends/gdx-backend-headless/src/com/badlogic/gdx/backends/headless/mock/input/MockInput.java
@@ -183,6 +183,26 @@ public class MockInput implements Input {
183183 }
184184
185185 @Override
186+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
187+
188+ }
189+
190+ @Override
191+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
192+
193+ }
194+
195+ @Override
196+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
197+
198+ }
199+
200+ @Override
201+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
202+
203+ }
204+
205+ @Override
186206 public float getAzimuth() {
187207 return 0;
188208 }
--- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/DefaultLwjglInput.java
+++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/DefaultLwjglInput.java
@@ -639,6 +639,26 @@ final public class DefaultLwjglInput extends AbstractInput implements LwjglInput
639639 }
640640
641641 @Override
642+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
643+
644+ }
645+
646+ @Override
647+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
648+
649+ }
650+
651+ @Override
652+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
653+
654+ }
655+
656+ @Override
657+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
658+
659+ }
660+
661+ @Override
642662 public boolean justTouched () {
643663 return justTouched;
644664 }
--- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglAWTInput.java
+++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglAWTInput.java
@@ -859,6 +859,26 @@ public class LwjglAWTInput extends AbstractInput implements MouseMotionListener,
859859 }
860860
861861 @Override
862+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
863+
864+ }
865+
866+ @Override
867+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
868+
869+ }
870+
871+ @Override
872+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
873+
874+ }
875+
876+ @Override
877+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
878+
879+ }
880+
881+ @Override
862882 public boolean justTouched () {
863883 return justTouched;
864884 }
--- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGraphics.java
+++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGraphics.java
@@ -730,6 +730,16 @@ public class LwjglGraphics extends AbstractGraphics {
730730 }
731731 }
732732
733+ @Override
734+ public long getViewHandle() {
735+ return 0;
736+ }
737+
738+ @Override
739+ public long getViewControllerHandle() {
740+ return 0;
741+ }
742+
733743 private class LwjglDisplayMode extends DisplayMode {
734744 org.lwjgl.opengl.DisplayMode mode;
735745
--- a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/DefaultLwjgl3Input.java
+++ b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/DefaultLwjgl3Input.java
@@ -674,6 +674,26 @@ public class DefaultLwjgl3Input extends AbstractInput implements Lwjgl3Input {
674674 }
675675
676676 @Override
677+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
678+
679+ }
680+
681+ @Override
682+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
683+
684+ }
685+
686+ @Override
687+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
688+
689+ }
690+
691+ @Override
692+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
693+
694+ }
695+
696+ @Override
677697 public float getAzimuth () {
678698 return 0;
679699 }
--- a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Graphics.java
+++ b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Graphics.java
@@ -505,6 +505,16 @@ public class Lwjgl3Graphics extends AbstractGraphics implements Disposable {
505505 }
506506
507507 @Override
508+ public long getViewHandle() {
509+ return 0;
510+ }
511+
512+ @Override
513+ public long getViewControllerHandle() {
514+ return 0;
515+ }
516+
517+ @Override
508518 public void dispose() {
509519 this.resizeCallback.free();
510520 }
--- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/DefaultIOSInput.java
+++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/DefaultIOSInput.java
@@ -563,6 +563,26 @@ public class DefaultIOSInput extends AbstractInput implements IOSInput {
563563 }
564564
565565 @Override
566+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
567+ haptics.vibrate(milliseconds, vibrationStyle, true);
568+ }
569+
570+ @Override
571+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
572+ haptics.vibrate(milliseconds, vibrationStyle, fallback);
573+ }
574+
575+ @Override
576+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
577+ haptics.vibrate(milliseconds, amplitude, vibrationStyle, fallback);
578+ }
579+
580+ @Override
581+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
582+ haptics.vibrate(vibrationType, vibrationStyle, fallback);
583+ }
584+
585+ @Override
566586 public long getCurrentEventTime () {
567587 return currentEventTimeStamp;
568588 }
--- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java
+++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplication.java
@@ -130,7 +130,7 @@ public class IOSApplication implements Application {
130130 Gdx.app.debug("IOSApplication", "Pixels per point: " + pixelsPerPoint);
131131
132132 this.uiWindow = new UIWindow(UIScreen.getMainScreen().getBounds());
133- this.uiWindow.makeKeyAndVisible();
133+// this.uiWindow.makeKeyAndVisible();
134134 uiApp.getDelegate().setWindow(uiWindow);
135135
136136 // setup libgdx
@@ -150,8 +150,13 @@ public class IOSApplication implements Application {
150150
151151 this.input.setupPeripherals();
152152
153- this.uiWindow.setRootViewController(this.graphics.viewController);
153+// this.uiWindow.setRootViewController(this.graphics.viewController);
154154 Gdx.app.debug("IOSApplication", "created");
155+ // We need to pass the uiWindow pointer to native side where setting the root view will happen.
156+ long uiWindowHandle = uiWindow.getHandle();
157+ config.uiWindowHandle = uiWindowHandle;
158+
159+ Gdx.app.getApplicationListener().create();
155160 return true;
156161 }
157162
@@ -268,7 +273,7 @@ public class IOSApplication implements Application {
268273 Gdx.app.debug("IOSApplication", "paused");
269274 graphics.makeCurrent();
270275 graphics.pause();
271- Gdx.gl.glFinish();
276+// Gdx.gl.glFinish();
272277 }
273278
274279 final void willTerminate (UIApplication uiApp) {
@@ -281,7 +286,7 @@ public class IOSApplication implements Application {
281286 }
282287 }
283288 listener.dispose();
284- Gdx.gl.glFinish();
289+// Gdx.gl.glFinish();
285290 }
286291
287292 @Override
--- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java
+++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSApplicationConfiguration.java
@@ -84,6 +84,8 @@ public class IOSApplicationConfiguration {
8484 * Prior to iOS 11, UIRectEdge.All was default behaviour if status bar hidden, see https://github.com/libgdx/libgdx/issues/5110 **/
8585 public UIRectEdge screenEdgesDeferringSystemGestures = UIRectEdge.None;
8686
87+ public long uiWindowHandle;
88+
8789 /** The maximum number of threads to use for network requests. Default is {@link Integer#MAX_VALUE}. */
8890 public int maxNetThreads = Integer.MAX_VALUE;
8991
--- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java
+++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSGraphics.java
@@ -91,58 +91,58 @@ public class IOSGraphics extends AbstractGraphics {
9191 // setup view and OpenGL
9292 screenBounds = app.computeBounds();
9393
94- if (useGLES30) {
95- context = new EAGLContext(EAGLRenderingAPI.OpenGLES3);
96- if (context != null)
97- gl20 = gl30 = new IOSGLES30();
98- else
99- Gdx.app.log("IOGraphics", "OpenGL ES 3.0 not supported, falling back on 2.0");
100- }
101- if (context == null) {
102- context = new EAGLContext(EAGLRenderingAPI.OpenGLES2);
103- gl20 = new IOSGLES20();
104- gl30 = null;
105- }
106-
107- IOSViewDelegate viewDelegate = new IOSViewDelegate();
108- view = new GLKView(new CGRect(0, 0, screenBounds.width, screenBounds.height), context) {
109- @Method(selector = "touchesBegan:withEvent:")
110- public void touchesBegan (@Pointer long touches, UIEvent event) {
111- IOSGraphics.this.input.onTouch(touches);
112- }
113-
114- @Method(selector = "touchesCancelled:withEvent:")
115- public void touchesCancelled (@Pointer long touches, UIEvent event) {
116- IOSGraphics.this.input.onTouch(touches);
117- }
118-
119- @Method(selector = "touchesEnded:withEvent:")
120- public void touchesEnded (@Pointer long touches, UIEvent event) {
121- IOSGraphics.this.input.onTouch(touches);
122- }
123-
124- @Method(selector = "touchesMoved:withEvent:")
125- public void touchesMoved (@Pointer long touches, UIEvent event) {
126- IOSGraphics.this.input.onTouch(touches);
127- }
128-
129- @Override
130- public void draw (CGRect rect) {
131- IOSGraphics.this.draw(this, rect);
132- }
133-
134- };
135- view.setDelegate(viewDelegate);
136- view.setDrawableColorFormat(config.colorFormat);
137- view.setDrawableDepthFormat(config.depthFormat);
138- view.setDrawableStencilFormat(config.stencilFormat);
139- view.setDrawableMultisample(config.multisample);
140- view.setMultipleTouchEnabled(true);
141-
142- viewController = app.createUIViewController(this);
143- viewController.setView(view);
144- viewController.setDelegate(viewDelegate);
145- viewController.setPreferredFramesPerSecond(config.preferredFramesPerSecond);
94+// if (useGLES30) {
95+// context = new EAGLContext(EAGLRenderingAPI.OpenGLES3);
96+// if (context != null)
97+// gl20 = gl30 = new IOSGLES30();
98+// else
99+// Gdx.app.log("IOGraphics", "OpenGL ES 3.0 not supported, falling back on 2.0");
100+// }
101+// if (context == null) {
102+// context = new EAGLContext(EAGLRenderingAPI.OpenGLES2);
103+// gl20 = new IOSGLES20();
104+// gl30 = null;
105+// }
106+//
107+// IOSViewDelegate viewDelegate = new IOSViewDelegate();
108+// view = new GLKView(new CGRect(0, 0, screenBounds.width, screenBounds.height), context) {
109+// @Method(selector = "touchesBegan:withEvent:")
110+// public void touchesBegan (@Pointer long touches, UIEvent event) {
111+// IOSGraphics.this.input.onTouch(touches);
112+// }
113+//
114+// @Method(selector = "touchesCancelled:withEvent:")
115+// public void touchesCancelled (@Pointer long touches, UIEvent event) {
116+// IOSGraphics.this.input.onTouch(touches);
117+// }
118+//
119+// @Method(selector = "touchesEnded:withEvent:")
120+// public void touchesEnded (@Pointer long touches, UIEvent event) {
121+// IOSGraphics.this.input.onTouch(touches);
122+// }
123+//
124+// @Method(selector = "touchesMoved:withEvent:")
125+// public void touchesMoved (@Pointer long touches, UIEvent event) {
126+// IOSGraphics.this.input.onTouch(touches);
127+// }
128+//
129+// @Override
130+// public void draw (CGRect rect) {
131+// IOSGraphics.this.draw(this, rect);
132+// }
133+//
134+// };
135+// view.setDelegate(viewDelegate);
136+// view.setDrawableColorFormat(config.colorFormat);
137+// view.setDrawableDepthFormat(config.depthFormat);
138+// view.setDrawableStencilFormat(config.stencilFormat);
139+// view.setDrawableMultisample(config.multisample);
140+// view.setMultipleTouchEnabled(true);
141+//
142+// viewController = app.createUIViewController(this);
143+// viewController.setView(view);
144+// viewController.setDelegate(viewDelegate);
145+// viewController.setPreferredFramesPerSecond(config.preferredFramesPerSecond);
146146
147147 this.app = app;
148148 this.input = input;
@@ -219,21 +219,21 @@ public class IOSGraphics extends AbstractGraphics {
219219 boolean created = false;
220220
221221 public void draw (GLKView view, CGRect rect) {
222- makeCurrent();
223- // massive hack, GLKView resets the viewport on each draw call, so IOSGLES20
224- // stores the last known viewport and we reset it here...
225- gl20.glViewport(IOSGLES20.x, IOSGLES20.y, IOSGLES20.width, IOSGLES20.height);
222+// makeCurrent();
223+// // massive hack, GLKView resets the viewport on each draw call, so IOSGLES20
224+// // stores the last known viewport and we reset it here...
225+// gl20.glViewport(IOSGLES20.x, IOSGLES20.y, IOSGLES20.width, IOSGLES20.height);
226226
227227 if (!created) {
228228 // OpenGL glViewport() function expects backbuffer coordinates instead of logical coordinates
229- gl20.glViewport(0, 0, screenBounds.backBufferWidth, screenBounds.backBufferHeight);
230-
231- String versionString = gl20.glGetString(GL20.GL_VERSION);
232- String vendorString = gl20.glGetString(GL20.GL_VENDOR);
233- String rendererString = gl20.glGetString(GL20.GL_RENDERER);
234- glVersion = new GLVersion(Application.ApplicationType.iOS, versionString, vendorString, rendererString);
235-
236- updateSafeInsets();
229+// gl20.glViewport(0, 0, screenBounds.backBufferWidth, screenBounds.backBufferHeight);
230+//
231+// String versionString = gl20.glGetString(GL20.GL_VERSION);
232+// String vendorString = gl20.glGetString(GL20.GL_VENDOR);
233+// String rendererString = gl20.glGetString(GL20.GL_RENDERER);
234+// glVersion = new GLVersion(Application.ApplicationType.iOS, versionString, vendorString, rendererString);
235+//
236+// updateSafeInsets();
237237 app.listener.create();
238238 app.listener.resize(getWidth(), getHeight());
239239 created = true;
@@ -264,16 +264,16 @@ public class IOSGraphics extends AbstractGraphics {
264264 }
265265
266266 void makeCurrent () {
267- EAGLContext.setCurrentContext(context);
267+// EAGLContext.setCurrentContext(context);
268268 }
269269
270270 public void update (GLKViewController controller) {
271- makeCurrent();
271+// makeCurrent();
272272 app.processRunnables();
273273 // pause the GLKViewController render loop if we are no longer continuous
274274 // and if we haven't requested a frame in the last loop iteration
275275 if (!isContinuous && !isFrameRequested) {
276- viewController.setPaused(true);
276+// viewController.setPaused(true);
277277 }
278278 isFrameRequested = false;
279279 }
@@ -497,6 +497,16 @@ public class IOSGraphics extends AbstractGraphics {
497497 }
498498
499499 @Override
500+ public long getViewHandle() {
501+ return 0;
502+ }
503+
504+ @Override
505+ public long getViewControllerHandle() {
506+ return 0;
507+ }
508+
509+ @Override
500510 public void setResizable(boolean resizable) {
501511 }
502512
@@ -528,7 +538,7 @@ public class IOSGraphics extends AbstractGraphics {
528538 if (isContinuous != this.isContinuous) {
529539 this.isContinuous = isContinuous;
530540 // start the GLKViewController if we go from non-continuous -> continuous
531- if (isContinuous) viewController.setPaused(false);
541+// if (isContinuous) viewController.setPaused(false);
532542 }
533543 }
534544
@@ -542,7 +552,7 @@ public class IOSGraphics extends AbstractGraphics {
542552 isFrameRequested = true;
543553 // start the GLKViewController if we are in non-continuous mode
544554 // (we should already be started in continuous mode)
545- if (!isContinuous) viewController.setPaused(false);
555+// if (!isContinuous) viewController.setPaused(false);
546556 }
547557
548558 @Override
--- a/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSHaptics.java
+++ b/backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/IOSHaptics.java
@@ -56,10 +56,14 @@ public class IOSHaptics {
5656 }
5757 }
5858 }
59-
59+
6060 public void vibrate(int milliseconds, boolean fallback) {
61+ vibrate(milliseconds, Input.VibrationStyle.CONTINUOUS, fallback);
62+ }
63+
64+ public void vibrate(int milliseconds, Input.VibrationStyle vibrationStyle, boolean fallback) {
6165 if (hapticsSupport) {
62- CHHapticPatternDict hapticDict = getChHapticPatternDict(milliseconds, 0.5f);
66+ CHHapticPatternDict hapticDict = getChHapticPatternDict(milliseconds, 0.5f, vibrationStyle);
6367 System.out.println(hapticDict);
6468 try {
6569 CHHapticPattern pattern = new CHHapticPattern(hapticDict);
@@ -77,9 +81,13 @@ public class IOSHaptics {
7781 }
7882
7983 public void vibrate(int milliseconds, int amplitude, boolean fallback) {
84+ vibrate(milliseconds, amplitude, Input.VibrationStyle.CONTINUOUS, fallback);
85+ }
86+
87+ public void vibrate(int milliseconds, int amplitude, Input.VibrationStyle vibrationStyle, boolean fallback) {
8088 if (hapticsSupport) {
8189 float intensity = MathUtils.clamp(amplitude / 255f, 0, 1);
82- CHHapticPatternDict hapticDict = getChHapticPatternDict(milliseconds, intensity);
90+ CHHapticPatternDict hapticDict = getChHapticPatternDict(milliseconds, intensity, vibrationStyle);
8391 try {
8492 CHHapticPattern pattern = new CHHapticPattern(hapticDict);
8593 NSError.NSErrorPtr ptr = new NSError.NSErrorPtr();
@@ -96,6 +104,10 @@ public class IOSHaptics {
96104 }
97105
98106 private CHHapticPatternDict getChHapticPatternDict(int milliseconds, float intensity) {
107+ return getChHapticPatternDict(milliseconds, intensity, Input.VibrationStyle.CONTINUOUS);
108+ }
109+
110+ private CHHapticPatternDict getChHapticPatternDict(int milliseconds, float intensity, Input.VibrationStyle vibrationStyle) {
99111 // NSArray<NSObject> parameters = new NSArray<NSObject>(
100112 // new CHHapticPatternDict().setEventParameters(
101113 // new NSArray<NSObject>(new NSDictionary<NSString, NSObject>(new NSString("ParameterID"), new NSString("HapticIntensity"), new NSString("ParameterValue"), NSNumber.valueOf(intensity)))
@@ -105,13 +117,24 @@ public class IOSHaptics {
105117 // NSArray<NSObject> parameters = new NSArray<NSObject>(
106118 // new NSArray<NSObject>(new CHHapticEventParameter(CHHapticEventParameterID.HapticIntensity, intensity))
107119 // );
120+ CHHapticEventType eventType = null;
121+ switch (vibrationStyle) {
122+ case TRANSIENT:
123+ eventType = CHHapticEventType.HapticTransient;
124+ break;
125+ case CONTINUOUS:
126+ eventType = CHHapticEventType.HapticContinuous;
127+ break;
128+ default:
129+ throw new IllegalStateException("Unexpected value: " + vibrationStyle);
130+ }
108131 return new CHHapticPatternDict()
109132 .setPattern(
110133 new NSArray<NSObject>(
111134 new CHHapticPatternDict()
112135 .setEvent(
113136 new CHHapticPatternDict()
114- .setEventType(CHHapticEventType.HapticTransient)
137+ .setEventType(eventType)
115138 .setTime(0.0)
116139 .setEventDuration(milliseconds / 1000f)
117140 .setEventParameters(new NSArray<NSObject>(new NSDictionary<NSString, NSObject>(new NSString("ParameterID"), new NSString("HapticIntensity"), new NSString("ParameterValue"), NSNumber.valueOf(intensity))))
@@ -121,8 +144,11 @@ public class IOSHaptics {
121144 );
122145 }
123146
124-
125147 public void vibrate (Input.VibrationType vibrationType, boolean fallback) {
148+ vibrate(vibrationType, Input.VibrationStyle.CONTINUOUS, fallback);
149+ }
150+
151+ public void vibrate (Input.VibrationType vibrationType, Input.VibrationStyle vibrationStyle, boolean fallback) {
126152 final int DEFAULT_LENGTH = 50;
127153 if (hapticsSupport) {
128154 UIImpactFeedbackStyle uiImpactFeedbackStyle;
--- a/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/DefaultGwtInput.java
+++ b/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/DefaultGwtInput.java
@@ -309,6 +309,26 @@ public class DefaultGwtInput extends AbstractInput implements GwtInput {
309309 }
310310
311311 @Override
312+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
313+
314+ }
315+
316+ @Override
317+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
318+
319+ }
320+
321+ @Override
322+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
323+
324+ }
325+
326+ @Override
327+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
328+
329+ }
330+
331+ @Override
312332 public float getAzimuth () {
313333 return 0;
314334 }
--- a/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtGraphics.java
+++ b/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtGraphics.java
@@ -565,6 +565,16 @@ public class GwtGraphics extends AbstractGraphics {
565565 ((GwtApplication)Gdx.app).graphics.canvas.getStyle().setProperty("cursor", GwtCursor.getNameForSystemCursor(systemCursor));
566566 }
567567
568+ @Override
569+ public long getViewHandle() {
570+ return 0;
571+ }
572+
573+ @Override
574+ public long getViewControllerHandle() {
575+ return 0;
576+ }
577+
568578 static class GwtMonitor extends Monitor {
569579 protected GwtMonitor (int virtualX, int virtualY, String name) {
570580 super(virtualX, virtualY, name);
--- a/gdx/src/com/badlogic/gdx/Graphics.java
+++ b/gdx/src/com/badlogic/gdx/Graphics.java
@@ -356,4 +356,8 @@ public interface Graphics {
356356 * Sets one of the predefined {@link SystemCursor}s
357357 */
358358 void setSystemCursor(SystemCursor systemCursor);
359+
360+ public long getViewHandle();
361+
362+ public long getViewControllerHandle();
359363 }
--- a/gdx/src/com/badlogic/gdx/Input.java
+++ b/gdx/src/com/badlogic/gdx/Input.java
@@ -804,6 +804,21 @@ public interface Input {
804804 public enum VibrationType {
805805 LIGHT, MEDIUM, HEAVY;
806806 }
807+
808+ /**
809+ * Defined mostly for iOS.
810+ */
811+ public enum VibrationStyle {
812+ TRANSIENT, CONTINUOUS;
813+ }
814+
815+ public void vibrate (int milliseconds, VibrationStyle vibrationStyle);
816+
817+ public void vibrate (int milliseconds, VibrationStyle vibrationStyle, boolean fallback);
818+
819+ public void vibrate (int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback);
820+
821+ public void vibrate (VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback);
807822
808823 /** The azimuth is the angle of the device's orientation around the z-axis. The positive z-axis points towards the earths
809824 * center.
--- a/gdx/src/com/badlogic/gdx/input/RemoteInput.java
+++ b/gdx/src/com/badlogic/gdx/input/RemoteInput.java
@@ -481,6 +481,26 @@ public class RemoteInput implements Runnable, Input {
481481 }
482482
483483 @Override
484+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
485+
486+ }
487+
488+ @Override
489+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
490+
491+ }
492+
493+ @Override
494+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
495+
496+ }
497+
498+ @Override
499+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
500+
501+ }
502+
503+ @Override
484504 public float getAzimuth () {
485505 return compass[0];
486506 }
--- a/tests/gdx-tests/src/com/badlogic/gdx/tests/AbstractTestWrapper.java
+++ b/tests/gdx-tests/src/com/badlogic/gdx/tests/AbstractTestWrapper.java
@@ -320,6 +320,26 @@ public abstract class AbstractTestWrapper extends GdxTest {
320320 }
321321
322322 @Override
323+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle) {
324+
325+ }
326+
327+ @Override
328+ public void vibrate(int milliseconds, VibrationStyle vibrationStyle, boolean fallback) {
329+
330+ }
331+
332+ @Override
333+ public void vibrate(int milliseconds, int amplitude, VibrationStyle vibrationStyle, boolean fallback) {
334+
335+ }
336+
337+ @Override
338+ public void vibrate(VibrationType vibrationType, VibrationStyle vibrationStyle, boolean fallback) {
339+
340+ }
341+
342+ @Override
323343 public float getAzimuth () {
324344 return input.getAzimuth();
325345 }