You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Merge pull request #96439 from darksylinc/matias-TheForge-pr03-rebased
Add Swappy & Pre-Transformed Swapchain
This commit is contained in:
@@ -47,6 +47,7 @@ import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.view.DisplayCutout;
|
||||
import android.view.Surface;
|
||||
import android.view.WindowInsets;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
@@ -295,6 +296,28 @@ public class GodotIO {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
This function is used by DisplayServer::screen_get_internal_current_rotation (C++)
|
||||
and is used to implement a performance optimization in devices that do not offer
|
||||
a HW rotator.
|
||||
@return
|
||||
Rotation in degrees, in multiples of 90°
|
||||
*/
|
||||
public int getInternalCurrentScreenRotation() {
|
||||
int rotation = activity.getWindowManager().getDefaultDisplay().getRotation();
|
||||
|
||||
switch (rotation) {
|
||||
case Surface.ROTATION_90:
|
||||
return 90;
|
||||
case Surface.ROTATION_180:
|
||||
return 180;
|
||||
case Surface.ROTATION_270:
|
||||
return 270;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void setEdit(GodotEditText _edit) {
|
||||
edit = _edit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user