From 8d44d3124e714f4c53fb71e6111b09c990b85238 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Thu, 18 Jan 2018 21:18:31 -0500 Subject: [PATCH] Android: Add callbacks for basic cursor handling. --- apps/openmw/android_main.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/openmw/android_main.c b/apps/openmw/android_main.c index 132e8ecf8..3f28afa1b 100644 --- a/apps/openmw/android_main.c +++ b/apps/openmw/android_main.c @@ -2,6 +2,8 @@ int stderr = 0; // Hack: fix linker error #include "SDL_main.h" #include +#include +#include /******************************************************************************* Functions called by JNI @@ -15,6 +17,25 @@ extern int argcData; extern const char **argvData; void releaseArgv(); + +int Java_org_libsdl_app_SDLActivity_getMouseX(JNIEnv *env, jclass cls, jobject obj) { + int ret = 0; + SDL_GetMouseState(&ret, NULL); + return ret; +} + + +int Java_org_libsdl_app_SDLActivity_getMouseY(JNIEnv *env, jclass cls, jobject obj) { + int ret = 0; + SDL_GetMouseState(NULL, &ret); + return ret; +} + +int Java_org_libsdl_app_SDLActivity_isMouseShown(JNIEnv *env, jclass cls, jobject obj) { + return SDL_ShowCursor(SDL_QUERY); +} + + int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj) {