diff options
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/os_osx.h | 3 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 23 |
2 files changed, 25 insertions, 1 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 5f761b672e..fba53f61b6 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -213,6 +213,9 @@ public: virtual bool _check_internal_feature_support(const String &p_feature); + virtual void set_use_vsync(bool p_enable); + virtual bool is_vsync_enabled() const; + void run(); void set_mouse_mode(MouseMode p_mode); diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 0d03d546b9..78acc97676 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1192,7 +1192,9 @@ typedef UnixTerminalLogger OSXTerminalLogger; void OS_OSX::initialize_logger() { Vector<Logger *> loggers; loggers.push_back(memnew(OSXTerminalLogger)); - loggers.push_back(memnew(RotatedFileLogger("user://logs/log.txt"))); + // FIXME: Reenable once we figure out how to get this properly in user:// + // instead of littering the user's working dirs (res:// + pwd) with log files (GH-12277) + //loggers.push_back(memnew(RotatedFileLogger("user://logs/log.txt"))); _set_logger(memnew(CompositeLogger(loggers))); } @@ -1818,6 +1820,8 @@ OS::LatinKeyboardVariant OS_OSX::get_latin_keyboard_variant() const { layout = LATIN_KEYBOARD_DVORAK; } else if ([test isEqualToString:@"xvlcwk"]) { layout = LATIN_KEYBOARD_NEO; + } else if ([test isEqualToString:@"qwfpgj"]) { + layout = LATIN_KEYBOARD_COLEMAK; } [test release]; @@ -1940,6 +1944,23 @@ Error OS_OSX::move_to_trash(const String &p_path) { return OK; } +void OS_OSX::set_use_vsync(bool p_enable) { + CGLContextObj ctx = CGLGetCurrentContext(); + if (ctx) { + GLint swapInterval = p_enable ? 1 : 0; + CGLSetParameter(ctx, kCGLCPSwapInterval, &swapInterval); + } +} + +bool OS_OSX::is_vsync_enabled() const { + GLint swapInterval = 0; + CGLContextObj ctx = CGLGetCurrentContext(); + if (ctx) { + CGLGetParameter(ctx, kCGLCPSwapInterval, &swapInterval); + } + return swapInterval ? true : false; +} + OS_OSX *OS_OSX::singleton = NULL; OS_OSX::OS_OSX() { |