1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

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:
Juan Linietsky
2016-06-05 19:14:33 -03:00
parent 684a1207c0
commit 2420e46b44
14 changed files with 107 additions and 2 deletions

View File

@@ -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 );