view src/main/android/SDL_android_main.cpp @ 4998:a514bfe6952a

The window is changed to reflect the actual screen dimensions, for now. Implemented SDL_SetWindowTitle(), which turned out to be fairly complex
author Sam Lantinga <slouken@libsdl.org>
date Thu, 13 Jan 2011 15:10:17 -0800
parents 6c645018741e
children 55fccf89b340
line wrap: on
line source


/* Include the SDL main definition header */
#include "SDL_main.h"

/*******************************************************************************
                 Functions called by JNI
*******************************************************************************/
#include <jni.h>

// Called before SDL_main() to initialize JNI bindings in SDL library
extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls);

// Library init
extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
{
    return JNI_VERSION_1_4;
}

// Start up the SDL app
extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj)
{
    /* This interface could expand with ABI negotiation, calbacks, etc. */
    SDL_Android_Init(env, cls);

    /* Run the application code! */
    char *argv[2];
    argv[0] = strdup("SDL_app");
    argv[1] = NULL;
    SDL_main(1, argv);
}