You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Implement OpenGL ES rasterizer selection logic for Android.
This commit is contained in:
@@ -614,6 +614,7 @@ static jmethodID _hideKeyboard = 0;
|
||||
static jmethodID _setScreenOrientation = 0;
|
||||
static jmethodID _getUniqueID = 0;
|
||||
static jmethodID _getSystemDir = 0;
|
||||
static jmethodID _getGLESVersionCode = 0;
|
||||
static jmethodID _playVideo = 0;
|
||||
static jmethodID _isVideoPlaying = 0;
|
||||
static jmethodID _pauseVideo = 0;
|
||||
@@ -685,6 +686,11 @@ static String _get_system_dir(int p_dir) {
|
||||
return String(env->GetStringUTFChars(s, NULL));
|
||||
}
|
||||
|
||||
static int _get_gles_version_code() {
|
||||
JNIEnv *env = ThreadAndroid::get_env();
|
||||
return env->CallIntMethod(_godot_instance, _getGLESVersionCode);
|
||||
}
|
||||
|
||||
static void _hide_vk() {
|
||||
|
||||
JNIEnv *env = ThreadAndroid::get_env();
|
||||
@@ -764,9 +770,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
|
||||
|
||||
godot_io = gob;
|
||||
|
||||
_on_video_init = env->GetMethodID(cls, "onVideoInit", "(Z)V");
|
||||
_on_video_init = env->GetMethodID(cls, "onVideoInit", "()V");
|
||||
_setKeepScreenOn = env->GetMethodID(cls, "setKeepScreenOn", "(Z)V");
|
||||
_alertDialog = env->GetMethodID(cls, "alert", "(Ljava/lang/String;Ljava/lang/String;)V");
|
||||
_getGLESVersionCode = env->GetMethodID(cls, "getGLESVersionCode", "()I");
|
||||
|
||||
jclass clsio = env->FindClass("org/godotengine/godot/Godot");
|
||||
if (cls) {
|
||||
@@ -800,16 +807,13 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
|
||||
AudioDriverAndroid::setup(gob);
|
||||
}
|
||||
|
||||
os_android = new OS_Android(_gfx_init_func, env, _open_uri, _get_user_data_dir, _get_locale, _get_model, _get_screen_dpi, _show_vk, _hide_vk, _get_vk_height, _set_screen_orient, _get_unique_id, _get_system_dir, _play_video, _is_video_playing, _pause_video, _stop_video, _set_keep_screen_on, _alert, p_use_apk_expansion);
|
||||
os_android = new OS_Android(_gfx_init_func, env, _open_uri, _get_user_data_dir, _get_locale, _get_model, _get_screen_dpi, _show_vk, _hide_vk, _get_vk_height, _set_screen_orient, _get_unique_id, _get_system_dir, _get_gles_version_code, _play_video, _is_video_playing, _pause_video, _stop_video, _set_keep_screen_on, _alert, p_use_apk_expansion);
|
||||
os_android->set_need_reload_hooks(p_need_reload_hook);
|
||||
|
||||
char wd[500];
|
||||
getcwd(wd, 500);
|
||||
|
||||
//video driver is determined here, because once initialized, it can't be changed
|
||||
// String vd = ProjectSettings::get_singleton()->get("display/driver");
|
||||
|
||||
env->CallVoidMethod(_godot_instance, _on_video_init, (jboolean) true);
|
||||
env->CallVoidMethod(_godot_instance, _on_video_init);
|
||||
}
|
||||
|
||||
static void _initialize_java_modules() {
|
||||
|
||||
Reference in New Issue
Block a user