summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-04 14:23:00 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-04 14:25:32 +0200
commit74d4343beb74424b400f5f65e620abf98b8c1562 (patch)
tree112db13930cf1b6fdae4eb742839f74774247366
parent99d6297a58c08926d4316b80c720ac602e236e6c (diff)
macOS: Use Metal on >60 Hz displays
The problem with the occasional stutters related to SDL_WaitEvent() are still there, but on a 120 Hz display it's even worse to be stuck on 60 Hz. Metal is required for 120 Hz.
-rw-r--r--res/about/version.gmi1
-rw-r--r--src/macos.m6
2 files changed, 4 insertions, 3 deletions
diff --git a/res/about/version.gmi b/res/about/version.gmi
index 8de16a87..9fa25707 100644
--- a/res/about/version.gmi
+++ b/res/about/version.gmi
@@ -11,6 +11,7 @@
11* Fixed how the ANSI FG color is adjusted to keep text legible on dark or bright backgrounds when BG color is unset. 11* Fixed how the ANSI FG color is adjusted to keep text legible on dark or bright backgrounds when BG color is unset.
12* Fixed possible crash when there are ANSI escapes in the alt text of a preformatted block. 12* Fixed possible crash when there are ANSI escapes in the alt text of a preformatted block.
13* Fixed tab/window titles containing ANSI escapes (escapes are removed). 13* Fixed tab/window titles containing ANSI escapes (escapes are removed).
14* macOS: Use Metal for drawing graphics if display refresh rate is higher than 60 Hz.
14 15
15## 1.10.3 16## 1.10.3
16* Unix: Added a lagrange(1) manual page. 17* Unix: Added a lagrange(1) manual page.
diff --git a/src/macos.m b/src/macos.m
index 1019d13d..ad236784 100644
--- a/src/macos.m
+++ b/src/macos.m
@@ -72,10 +72,10 @@ static NSString *currentSystemAppearance_(void) {
72} 72}
73 73
74iBool shouldDefaultToMetalRenderer_MacOS(void) { 74iBool shouldDefaultToMetalRenderer_MacOS(void) {
75 /* TODO: Test if SDL 2.0.16 works better (no stutters with Metal?). */
76 return iFalse; /*
77 const iInt2 ver = macVer_(); 75 const iInt2 ver = macVer_();
78 return ver.x > 10 || ver.y > 13;*/ 76 SDL_DisplayMode dispMode;
77 SDL_GetDesktopDisplayMode(0, &dispMode);
78 return dispMode.refresh_rate > 60 && (ver.x > 10 || ver.y > 13);
79} 79}
80 80
81static void ignoreImmediateKeyDownEvents_(void) { 81static void ignoreImmediateKeyDownEvents_(void) {