1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 01:45:34 +00:00

Merge pull request #2096 from xyzz/android-relative-mouse

android: Add a method so that we can send relative mouse movements from java.
This commit is contained in:
Bret Curtis 2018-12-26 10:41:35 +01:00 committed by GitHub
commit f18f2d39e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,6 +35,17 @@ int Java_org_libsdl_app_SDLActivity_isMouseShown(JNIEnv *env, jclass cls, jobjec
return SDL_ShowCursor(SDL_QUERY);
}
extern SDL_Window *Android_Window;
int SDL_SendMouseMotion(SDL_Window * window, int mouseID, int relative, int x, int y);
void Java_org_libsdl_app_SDLActivity_sendRelativeMouseMotion(JNIEnv *env, jclass cls, int x, int y) {
SDL_SendMouseMotion(Android_Window, 0, 1, x, y);
}
int SDL_SendMouseButton(SDL_Window * window, int mouseID, Uint8 state, Uint8 button);
void Java_org_libsdl_app_SDLActivity_sendMouseButton(JNIEnv *env, jclass cls, int state, int button) {
SDL_SendMouseButton(Android_Window, 0, state, button);
}
int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj) {
setenv("OPENMW_DECOMPRESS_TEXTURES", "1", 1);