From 6857abd51afdb08bc7f9955d9367d155c6bf1a80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi
Date: Sun, 27 Sep 2020 14:44:43 +0300
Subject: [PATCH 1/1] macOS: 10.13 should use OpenGL renderer
There appears to be a problem with SDL's Metal renderer under 10.13 (segfault on window creation).
src/macos.h | 2 ++
src/macos.m | 19 +++++++++++++++----
src/ui/window.c | 2 +-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/macos.h b/src/macos.h
index 07990090..700d50f8 100644
--- a/src/macos.h
+++ b/src/macos.h
@@ -26,6 +26,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* Platform-specific functionality for macOS */
+iBool shouldDefaultToMetalRenderer_MacOS (void);
void setupApplication_MacOS (void);
void insertMenuItems_MacOS (const char *menuLabel, int atIndex, const iMenuItem *items, size_t count);
void handleCommand_MacOS (const char *cmd);
diff --git a/src/macos.m b/src/macos.m
index 975ba928..1d972ebd 100644
--- a/src/macos.m
+++ b/src/macos.m
@@ -38,14 +38,25 @@ enum iTouchBarVariant {
default_TouchBarVariant,
};
+static iInt2 macVer_(void) {
const NSOperatingSystemVersion ver = [[NSProcessInfo processInfo] operatingSystemVersion];
return init_I2(ver.majorVersion, ver.minorVersion);
+}
static NSString *currentSystemAppearance_(void) {
/* This API does not exist on 10.13. */
return [[NSApp effectiveAppearance] name];
}
return @"NSAppearanceNameAqua";
+}
+iBool shouldDefaultToMetalRenderer_MacOS(void) {
}
/----------------------------------------------------------------------------------------------/
diff --git a/src/ui/window.c b/src/ui/window.c
index b1fd3a07..97d56ec5 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -522,7 +522,7 @@ void init_Window(iWindow *d, iRect rect) {
d->isDrawFrozen = iTrue;
uint32_t flags = 0;
#if defined (iPlatformApple)
#else
flags |= SDL_WINDOW_OPENGL;
#endif
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).