Path: blob/master/dependencies/android/androidHelpers.hpp
774 views
#ifndef ANDROIDHELPERS_H1#define ANDROIDHELPERS_H2// god i need to sort these out soon3#include <jni.h>4#include <android/native_window.h>5#include <android/native_window_jni.h>6#include <android/window.h>7#include <pthread.h>8#include <paddleboat/paddleboat.h>910#include <game-activity/native_app_glue/android_native_app_glue.h>1112#include <swappy/swappyGL.h>13#include <swappy/swappyGL_extra.h>1415struct JNISetup {16jclass clazz; // activity class17jobject thiz; // activity object18JNIEnv *env; // jni env19};20struct JNISetup *GetJNISetup();2122typedef struct android_app android_app;23extern android_app *app;24extern jmethodID getFD;25extern jmethodID writeLog;2627extern jmethodID showLoading;28extern jmethodID hideLoading;29extern jmethodID setLoading;30extern jmethodID setPixSize;3132class GameActivity;33class GameActivityKeyEvent;3435#define jniname(name, class) Java_org_rems_rsdkv5_##class##_##name36#define jnifunc(name, class, ...) jniname(name, class)(JNIEnv *env, jclass cls, __VA_ARGS__)37#define jnifuncN(name, class) jniname(name, class)(JNIEnv *env, jclass cls)3839extern "C" JNIEXPORT void JNICALL jnifunc(nativeOnTouch, RSDK, jint finger, jint action, jfloat x, jfloat y);40extern "C" JNIEXPORT jbyteArray JNICALL jnifunc(nativeLoadFile, RSDK, jstring file);4142void AndroidCommandCallback(android_app *app, int32 cmd);43bool AndroidKeyDownCallback(GameActivity *activity, const GameActivityKeyEvent *event);44bool AndroidKeyUpCallback(GameActivity *activity, const GameActivityKeyEvent *event);4546void ShowLoadingIcon();47void HideLoadingIcon();48void SetLoadingIcon();4950#endif // ANDROID_ANDROIDHELPERS_H515253