diff options
author | Bastiaan Olij <mux213@gmail.com> | 2023-06-08 12:05:20 +1000 |
---|---|---|
committer | Fredia Huya-Kouadio <fhuya@meta.com> | 2023-10-02 14:02:23 -0700 |
commit | 9e56e7a3ceabc5c65e9ae749be5981eb61b49370 (patch) | |
tree | cdd21478ae448ca1f30b5924041d7e493d9f05f8 /platform/android/java_godot_wrapper.cpp | |
parent | a2f90d565ad29edcb3bdab77bc7df51cdde8514a (diff) | |
download | redot-engine-9e56e7a3ceabc5c65e9ae749be5981eb61b49370.tar.gz |
Add support for the OpenXR Eye gaze interaction extension
Co-authored-by: Bastiaan Olij <mux213@gmail.com>
Diffstat (limited to 'platform/android/java_godot_wrapper.cpp')
-rw-r--r-- | platform/android/java_godot_wrapper.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index 1703179b8e..cb6ebf14a8 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -82,6 +82,7 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_activity, jobject p_ _end_benchmark_measure = p_env->GetMethodID(godot_class, "nativeEndBenchmarkMeasure", "(Ljava/lang/String;)V"); _dump_benchmark = p_env->GetMethodID(godot_class, "nativeDumpBenchmark", "(Ljava/lang/String;)V"); _get_gdextension_list_config_file = p_env->GetMethodID(godot_class, "getGDExtensionConfigFiles", "()[Ljava/lang/String;"); + _has_feature = p_env->GetMethodID(godot_class, "hasFeature", "(Ljava/lang/String;)Z"); } GodotJavaWrapper::~GodotJavaWrapper() { @@ -373,3 +374,15 @@ void GodotJavaWrapper::dump_benchmark(const String &benchmark_file) { env->CallVoidMethod(godot_instance, _dump_benchmark, j_benchmark_file); } } + +bool GodotJavaWrapper::has_feature(const String &p_feature) const { + if (_has_feature) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_NULL_V(env, false); + + jstring j_feature = env->NewStringUTF(p_feature.utf8().get_data()); + return env->CallBooleanMethod(godot_instance, _has_feature, j_feature); + } else { + return false; + } +} |