src/main/android/SDL_android_main.cpp
changeset 7501 b27825bb5879
parent 7500 6b484ff38f86
child 7502 6ff02ff3cf06
equal deleted inserted replaced
7500:6b484ff38f86 7501:b27825bb5879
     1 
       
     2 #include "SDL_config.h"
       
     3 
       
     4 #ifdef __ANDROID__
       
     5 
       
     6 /* Include the SDL main definition header */
       
     7 #include "SDL_main.h"
       
     8 
       
     9 /*******************************************************************************
       
    10                  Functions called by JNI
       
    11 *******************************************************************************/
       
    12 #include <jni.h>
       
    13 
       
    14 // Called before SDL_main() to initialize JNI bindings in SDL library
       
    15 extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls);
       
    16 
       
    17 // Start up the SDL app
       
    18 extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj)
       
    19 {
       
    20     /* This interface could expand with ABI negotiation, calbacks, etc. */
       
    21     SDL_Android_Init(env, cls);
       
    22 
       
    23     SDL_SetMainReady();
       
    24 
       
    25     /* Run the application code! */
       
    26     int status;
       
    27     char *argv[2];
       
    28     argv[0] = SDL_strdup("SDL_app");
       
    29     argv[1] = NULL;
       
    30     status = SDL_main(1, argv);
       
    31 
       
    32     /* Do not issue an exit or the whole application will terminate instead of just the SDL thread */
       
    33     //exit(status);
       
    34 }
       
    35 
       
    36 #endif /* __ANDROID__ */
       
    37 
       
    38 /* vi: set ts=4 sw=4 expandtab: */