Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/dependencies/android/androidHelpers.hpp
774 views
1
#ifndef ANDROIDHELPERS_H
2
#define ANDROIDHELPERS_H
3
// god i need to sort these out soon
4
#include <jni.h>
5
#include <android/native_window.h>
6
#include <android/native_window_jni.h>
7
#include <android/window.h>
8
#include <pthread.h>
9
#include <paddleboat/paddleboat.h>
10
11
#include <game-activity/native_app_glue/android_native_app_glue.h>
12
13
#include <swappy/swappyGL.h>
14
#include <swappy/swappyGL_extra.h>
15
16
struct JNISetup {
17
jclass clazz; // activity class
18
jobject thiz; // activity object
19
JNIEnv *env; // jni env
20
};
21
struct JNISetup *GetJNISetup();
22
23
typedef struct android_app android_app;
24
extern android_app *app;
25
extern jmethodID getFD;
26
extern jmethodID writeLog;
27
28
extern jmethodID showLoading;
29
extern jmethodID hideLoading;
30
extern jmethodID setLoading;
31
extern jmethodID setPixSize;
32
33
class GameActivity;
34
class GameActivityKeyEvent;
35
36
#define jniname(name, class) Java_org_rems_rsdkv5_##class##_##name
37
#define jnifunc(name, class, ...) jniname(name, class)(JNIEnv *env, jclass cls, __VA_ARGS__)
38
#define jnifuncN(name, class) jniname(name, class)(JNIEnv *env, jclass cls)
39
40
extern "C" JNIEXPORT void JNICALL jnifunc(nativeOnTouch, RSDK, jint finger, jint action, jfloat x, jfloat y);
41
extern "C" JNIEXPORT jbyteArray JNICALL jnifunc(nativeLoadFile, RSDK, jstring file);
42
43
void AndroidCommandCallback(android_app *app, int32 cmd);
44
bool AndroidKeyDownCallback(GameActivity *activity, const GameActivityKeyEvent *event);
45
bool AndroidKeyUpCallback(GameActivity *activity, const GameActivityKeyEvent *event);
46
47
void ShowLoadingIcon();
48
void HideLoadingIcon();
49
void SetLoadingIcon();
50
51
#endif // ANDROID_ANDROIDHELPERS_H
52
53