summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp11
-rw-r--r--core/bind/core_bind.h3
-rw-r--r--core/os/os.cpp8
-rw-r--r--core/os/os.h3
4 files changed, 25 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index addc26525e..31c0c0e208 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -436,6 +436,15 @@ Error _OS::set_thread_name(const String& p_name) {
return Thread::set_name(p_name);
};
+void _OS::set_use_vsync(bool p_enable) {
+ OS::get_singleton()->set_use_vsync(p_enable);
+}
+
+bool _OS::is_vsnc_enabled() const {
+
+ return OS::get_singleton()->is_vsnc_enabled();
+}
+
/*
enum Weekday {
@@ -1110,6 +1119,8 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name);
+ ObjectTypeDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync);
+ ObjectTypeDB::bind_method(_MD("is_vsnc_enabled"),&_OS::is_vsnc_enabled);
BIND_CONSTANT( DAY_SUNDAY );
BIND_CONSTANT( DAY_MONDAY );
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index af89536c45..441927940d 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -282,6 +282,9 @@ public:
Error set_thread_name(const String& p_name);
+ void set_use_vsync(bool p_enable);
+ bool is_vsnc_enabled() const;
+
static _OS *get_singleton() { return singleton; }
_OS();
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 4daf41e68e..e501bc2eb5 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -539,6 +539,14 @@ String OS::get_joy_guid(int p_device) const {
void OS::set_context(int p_context) {
}
+void OS::set_use_vsync(bool p_enable) {
+
+}
+
+bool OS::is_vsnc_enabled() const{
+
+ return true;
+}
OS::OS() {
last_error=NULL;
diff --git a/core/os/os.h b/core/os/os.h
index a1047bd48f..c291d09250 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -420,6 +420,9 @@ public:
virtual void set_context(int p_context);
+ virtual void set_use_vsync(bool p_enable);
+ virtual bool is_vsnc_enabled() const;
+
bool is_hidpi_allowed() const { return _allow_hidpi; }
OS();
virtual ~OS();