From e3495ede6128250b7b3f4326a784be2fa6a10b22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Tue, 28 Sep 2021 14:21:37 +0300
Subject: [PATCH 1/1] Window: Automatic software rendering fallback
src/ui/window.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/ui/window.c b/src/ui/window.c
index d66015a8..686a6dd6 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -380,12 +380,6 @@ void create_Window_(iWindow *d, iRect rect, uint32_t flags) {
}
#endif
}
-#if 0
width_Rect(rect), height_Rect(rect), flags, &d->win, &d->render)) {
return iFalse;
-#endif
const iBool setPos = left_Rect(rect) >= 0 || top_Rect(rect) >= 0;
d->win = SDL_CreateWindow("",
setPos ? left_Rect(rect) : SDL_WINDOWPOS_CENTERED,
@@ -394,8 +388,20 @@ void create_Window_(iWindow *d, iRect rect, uint32_t flags) {
height_Rect(rect),
flags);
if (!d->win) {
fprintf(stderr, "[window] failed to create window: %s\n", SDL_GetError());
exit(-3);
if (flags & SDL_WINDOW_OPENGL) {
/* Try without OpenGL support, then. */
setForceSoftwareRender_App(iTrue);
d->win = SDL_CreateWindow("",
setPos ? left_Rect(rect) : SDL_WINDOWPOS_CENTERED,
setPos ? top_Rect(rect) : SDL_WINDOWPOS_CENTERED,
width_Rect(rect),
height_Rect(rect),
flags & ~SDL_WINDOW_OPENGL);
}
if (!d->win) {
fprintf(stderr, "[window] failed to create window: %s\n", SDL_GetError());
exit(-3);
}
}
if (forceSoftwareRender_App()) {
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software");
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).