From bb193e1b764dfdbfcf604886d85e5cbc3664a408 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 8 Nov 2009 02:56:14 -0500 Subject: [PATCH] Try fallbacks if we can't set video mode. --- Source/OpenGL_Windows.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 2efaac4..2937fef 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -887,7 +887,20 @@ Boolean SetUp (Game & game) if (SDL_SetVideoMode(kContextWidth, kContextHeight, 0, sdlflags) == NULL) { fprintf(stderr, "SDL_SetVideoMode() failed: %s\n", SDL_GetError()); - return false; + fprintf(stderr, "forcing 640x480...\n"); + kContextWidth = 640; + kContextHeight = 480; + if (SDL_SetVideoMode(kContextWidth, kContextHeight, 0, sdlflags) == NULL) + { + fprintf(stderr, "SDL_SetVideoMode() failed: %s\n", SDL_GetError()); + fprintf(stderr, "forcing 640x480 windowed mode...\n"); + sdlflags &= ~SDL_FULLSCREEN; + if (SDL_SetVideoMode(kContextWidth, kContextHeight, 0, sdlflags) == NULL) + { + fprintf(stderr, "SDL_SetVideoMode() failed: %s\n", SDL_GetError()); + return false; + } + } } if (!lookup_all_glsyms()) -- 2.39.5