aboutsummaryrefslogtreecommitdiff
path: root/core/bind/core_bind.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2018-02-14 00:14:59 +0100
committerGitHub2018-02-14 00:14:59 +0100
commit71ea00a358d430a110ae142ef548b5e720b622b0 (patch)
treeb7674b9f4f93f95fda5c536595e98f13d33d8ac5 /core/bind/core_bind.cpp
parentba106ae51c01c45ccca2c599357d4304482b78fb (diff)
parentea1d726a4603fdd6bd4dfa6c1fa3128cfb2915c7 (diff)
downloadgodot-71ea00a358d430a110ae142ef548b5e720b622b0.tar.gz
godot-71ea00a358d430a110ae142ef548b5e720b622b0.tar.zst
godot-71ea00a358d430a110ae142ef548b5e720b622b0.zip
Merge pull request #16648 from marcelofg55/center_window
Added OS::center_window to center the window precisely on desktop platforms
Diffstat (limited to 'core/bind/core_bind.cpp')
-rw-r--r--core/bind/core_bind.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 32b94b9b0..8f1a57e36 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -264,6 +264,10 @@ Size2 _OS::get_window_size() const {
return OS::get_singleton()->get_window_size();
}
+Size2 _OS::get_real_window_size() const {
+ return OS::get_singleton()->get_real_window_size();
+}
+
void _OS::set_window_size(const Size2 &p_size) {
OS::get_singleton()->set_window_size(p_size);
}
@@ -929,6 +933,11 @@ void _OS::request_attention() {
OS::get_singleton()->request_attention();
}
+void _OS::center_window() {
+
+ OS::get_singleton()->center_window();
+}
+
bool _OS::is_debug_build() const {
#ifdef DEBUG_ENABLED
@@ -1017,6 +1026,8 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_window_maximized", "enabled"), &_OS::set_window_maximized);
ClassDB::bind_method(D_METHOD("is_window_maximized"), &_OS::is_window_maximized);
ClassDB::bind_method(D_METHOD("request_attention"), &_OS::request_attention);
+ ClassDB::bind_method(D_METHOD("get_real_window_size"), &_OS::get_real_window_size);
+ ClassDB::bind_method(D_METHOD("center_window"), &_OS::center_window);
ClassDB::bind_method(D_METHOD("set_borderless_window", "borderless"), &_OS::set_borderless_window);
ClassDB::bind_method(D_METHOD("get_borderless_window"), &_OS::get_borderless_window);