1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 03:39:14 +00:00
OpenMW/apps/openmw/android_main.c

39 lines
901 B
C
Raw Normal View History

2014-08-04 15:52:01 +00:00
#include "../../SDL_internal.h"
#ifdef __ANDROID__
#include "SDL_main.h"
/*******************************************************************************
2015-03-15 17:15:58 +00:00
Functions called by JNI
*******************************************************************************/
2014-08-04 15:52:01 +00:00
#include <jni.h>
2014-08-05 20:46:21 +00:00
/* Called before to initialize JNI bindings */
2014-08-04 15:52:01 +00:00
extern void SDL_Android_Init(JNIEnv* env, jclass cls);
2015-03-15 17:15:58 +00:00
extern int argcData;
extern const char **argvData;
2015-03-16 14:21:38 +00:00
void releaseArgv();
2015-03-15 17:15:58 +00:00
int Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls,
jobject obj) {
2015-03-15 17:15:58 +00:00
SDL_Android_Init(env, cls);
2015-03-15 17:15:58 +00:00
SDL_SetMainReady();
2014-08-04 15:52:01 +00:00
/* Run the application code! */
2014-08-05 20:46:21 +00:00
int status;
2014-08-04 15:52:01 +00:00
status = main(argcData+1, argvData);
releaseArgv();
/* Do not issue an exit or the whole application will terminate instead of just the SDL thread */
/* exit(status); */
2014-08-04 15:52:01 +00:00
return status;
2014-08-04 15:52:01 +00:00
}
#endif /* __ANDROID__ */