summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/window.c22
1 files 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) {
380 } 380 }
381#endif 381#endif
382 } 382 }
383#if 0
384 if (SDL_CreateWindowAndRenderer(
385 width_Rect(rect), height_Rect(rect), flags, &d->win, &d->render)) {
386 return iFalse;
387 }
388#endif
389 const iBool setPos = left_Rect(rect) >= 0 || top_Rect(rect) >= 0; 383 const iBool setPos = left_Rect(rect) >= 0 || top_Rect(rect) >= 0;
390 d->win = SDL_CreateWindow("", 384 d->win = SDL_CreateWindow("",
391 setPos ? left_Rect(rect) : SDL_WINDOWPOS_CENTERED, 385 setPos ? left_Rect(rect) : SDL_WINDOWPOS_CENTERED,
@@ -394,8 +388,20 @@ void create_Window_(iWindow *d, iRect rect, uint32_t flags) {
394 height_Rect(rect), 388 height_Rect(rect),
395 flags); 389 flags);
396 if (!d->win) { 390 if (!d->win) {
397 fprintf(stderr, "[window] failed to create window: %s\n", SDL_GetError()); 391 if (flags & SDL_WINDOW_OPENGL) {
398 exit(-3); 392 /* Try without OpenGL support, then. */
393 setForceSoftwareRender_App(iTrue);
394 d->win = SDL_CreateWindow("",
395 setPos ? left_Rect(rect) : SDL_WINDOWPOS_CENTERED,
396 setPos ? top_Rect(rect) : SDL_WINDOWPOS_CENTERED,
397 width_Rect(rect),
398 height_Rect(rect),
399 flags & ~SDL_WINDOW_OPENGL);
400 }
401 if (!d->win) {
402 fprintf(stderr, "[window] failed to create window: %s\n", SDL_GetError());
403 exit(-3);
404 }
399 } 405 }
400 if (forceSoftwareRender_App()) { 406 if (forceSoftwareRender_App()) {
401 SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software"); 407 SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software");