vsync support
-works on windows -may not work on X11, if so please fix -OSX does not seem to support disabling vsync
This commit is contained in:
parent
684a1207c0
commit
2420e46b44
14 changed files with 107 additions and 2 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue