comparison src/main/android/SDL_android_main.cpp @ 4964:6c645018741e

Build the SDL library as a shared object on Android, so it will work correctly with SDL_image and SDL_ttf.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 06 Jan 2011 16:11:21 -0800
parents
children a514bfe6952a
comparison
equal deleted inserted replaced
4963:604077962776 4964:6c645018741e
1
2 /* Include the SDL main definition header */
3 #include "SDL_main.h"
4
5 /*******************************************************************************
6 Functions called by JNI
7 *******************************************************************************/
8 #include <jni.h>
9
10 // Called before SDL_main() to initialize JNI bindings in SDL library
11 extern "C" void SDL_Android_Init(JNIEnv* env);
12
13 // Library init
14 extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
15 {
16 return JNI_VERSION_1_4;
17 }
18
19 // Start up the SDL app
20 extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit( JNIEnv* env, jobject obj )
21 {
22 /* This interface could expand with ABI negotiation, calbacks, etc. */
23 SDL_Android_Init(env);
24
25 /* Run the application code! */
26 char *argv[2];
27 argv[0] = strdup("SDL_app");
28 argv[1] = NULL;
29 SDL_main(1, argv);
30 }