Quellcode durchsuchen

android: implement JNI_OnLoad and use Log::Info instead of the native

Android functions.
legacy
Sam Hocevar sam vor 13 Jahren
Ursprung
Commit
ed3d51f00c
1 geänderte Dateien mit 10 neuen und 2 gelöschten Zeilen
  1. +10
    -2
      src/androidapp.cpp

+ 10
- 2
src/androidapp.cpp Datei anzeigen

@@ -29,6 +29,12 @@ jobject g_ctx;
JNIEnv *g_env;
};

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

extern "C" void
Java_org_zoy_LolEngine_LolActivity_nativeInit(JNIEnv* env, jobject thiz)
{
@@ -39,9 +45,11 @@ Java_org_zoy_LolEngine_LolActivity_nativeInit(JNIEnv* env, jobject thiz)
extern "C" void
Java_org_zoy_LolEngine_LolRenderer_nativeInit(JNIEnv* env)
{
/* We cannot use JNI_OnLoad for this because we're in a different
* thread now. */
g_env = env;

__android_log_print(ANDROID_LOG_INFO, "LOL", "init");
Log::Info("initialising renderer");
Ticker::Setup(30.0f);
Video::Setup(vec2i(320, 200));

@@ -53,7 +61,7 @@ extern "C" void
Java_org_zoy_LolEngine_LolRenderer_nativeResize(JNIEnv* env, jobject thiz,
jint w, jint h)
{
__android_log_print(ANDROID_LOG_INFO, "LOL", "resize w=%d h=%d", w, h);
Log::Info("resizing to %i x %i", w, h);
Video::Setup(vec2i(w, h));
}



Laden…
Abbrechen
Speichern