You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Setup Godot to support the Oculus Mobile SDK.
This commit is contained in:
@@ -60,6 +60,8 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_godot_instance) {
|
||||
_set_clipboard = p_env->GetMethodID(cls, "setClipboard", "(Ljava/lang/String;)V");
|
||||
_request_permission = p_env->GetMethodID(cls, "requestPermission", "(Ljava/lang/String;)Z");
|
||||
_init_input_devices = p_env->GetMethodID(cls, "initInputDevices", "()V");
|
||||
_get_surface = p_env->GetMethodID(cls, "getSurface", "()Landroid/view/Surface;");
|
||||
_is_activity_resumed = p_env->GetMethodID(cls, "isActivityResumed", "()Z");
|
||||
}
|
||||
|
||||
GodotJavaWrapper::~GodotJavaWrapper() {
|
||||
@@ -191,3 +193,21 @@ void GodotJavaWrapper::init_input_devices() {
|
||||
env->CallVoidMethod(godot_instance, _init_input_devices);
|
||||
}
|
||||
}
|
||||
|
||||
jobject GodotJavaWrapper::get_surface() {
|
||||
if (_get_surface) {
|
||||
JNIEnv *env = ThreadAndroid::get_env();
|
||||
return env->CallObjectMethod(godot_instance, _get_surface);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
bool GodotJavaWrapper::is_activity_resumed() {
|
||||
if (_is_activity_resumed) {
|
||||
JNIEnv *env = ThreadAndroid::get_env();
|
||||
return env->CallBooleanMethod(godot_instance, _is_activity_resumed);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user