diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-05 22:14:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-05 22:14:38 +0100 |
commit | 93f7c63ba5f14a963c6857eb61dbc032d6d3b66d (patch) | |
tree | 27133f40aa4c4c204ec6a7a3fe9bec77ba145fbb /platform/android/java_godot_wrapper.cpp | |
parent | 60ea8aea98e76fd4514c65ca1ebd7f015283e991 (diff) | |
parent | f097defba135dcc8d195019c0ce0e4bf171b07a7 (diff) |
Merge pull request #33682 from m4gr3d/rearch_godot_android_plugin
Re-architecture of the Godot Android plugin.
Diffstat (limited to 'platform/android/java_godot_wrapper.cpp')
-rw-r--r-- | platform/android/java_godot_wrapper.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index 9ac91b8ef6..7b677c186e 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -66,6 +66,7 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_godot_instance) { _is_activity_resumed = p_env->GetMethodID(cls, "isActivityResumed", "()Z"); _vibrate = p_env->GetMethodID(cls, "vibrate", "(I)V"); _get_input_fallback_mapping = p_env->GetMethodID(cls, "getInputFallbackMapping", "()Ljava/lang/String;"); + _on_gl_godot_main_loop_started = p_env->GetMethodID(cls, "onGLGodotMainLoopStarted", "()V"); } GodotJavaWrapper::~GodotJavaWrapper() { @@ -107,6 +108,15 @@ void GodotJavaWrapper::on_video_init(JNIEnv *p_env) { p_env->CallVoidMethod(godot_instance, _on_video_init); } +void GodotJavaWrapper::on_gl_godot_main_loop_started(JNIEnv *p_env) { + if (_on_gl_godot_main_loop_started) { + if (p_env == NULL) { + p_env = ThreadAndroid::get_env(); + } + } + p_env->CallVoidMethod(godot_instance, _on_gl_godot_main_loop_started); +} + void GodotJavaWrapper::restart(JNIEnv *p_env) { if (_restart) if (p_env == NULL) |