mirror of
https://github.com/godotengine/godot.git
synced 2026-02-13 22:27:17 +00:00
Merge pull request #115434 from syntaxerror247/landscape-or-portrait
Add device orientation change signal to DisplayServer
This commit is contained in:
@@ -662,7 +662,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererPaused(JNIE
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onScreenRotationChange(JNIEnv *env, jclass clazz, jint p_orientation) {
|
||||
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onOrientationChange(JNIEnv *env, jclass clazz, jint p_orientation) {
|
||||
if (step.get() <= STEP_SETUP) {
|
||||
return;
|
||||
}
|
||||
@@ -671,6 +671,11 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onScreenRotationChang
|
||||
if (camera_server) {
|
||||
camera_server->handle_display_rotation_change(p_orientation);
|
||||
}
|
||||
|
||||
DisplayServer *display_server = DisplayServer::get_singleton();
|
||||
if (display_server) {
|
||||
display_server->emit_signal("orientation_changed", p_orientation);
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_godotengine_godot_GodotLib_shouldDispatchInputToRenderThread(JNIEnv *env, jclass clazz) {
|
||||
|
||||
Reference in New Issue
Block a user