mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
Android: Add callbacks for basic cursor handling.
This commit is contained in:
parent
359910762d
commit
8d44d3124e
@ -2,6 +2,8 @@ int stderr = 0; // Hack: fix linker error
|
|||||||
|
|
||||||
#include "SDL_main.h"
|
#include "SDL_main.h"
|
||||||
#include <SDL_gamecontroller.h>
|
#include <SDL_gamecontroller.h>
|
||||||
|
#include <SDL_mouse.h>
|
||||||
|
#include <SDL_events.h>
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
Functions called by JNI
|
Functions called by JNI
|
||||||
@ -15,6 +17,25 @@ extern int argcData;
|
|||||||
extern const char **argvData;
|
extern const char **argvData;
|
||||||
void releaseArgv();
|
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,
|
int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls,
|
||||||
jobject obj) {
|
jobject obj) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user