From: Ryan C. Gordon Date: Sun, 8 Nov 2009 07:56:14 +0000 (-0500) Subject: Try fallbacks if we can't set video mode. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=bb193e1b764dfdbfcf604886d85e5cbc3664a408;p=lugaru.git Try fallbacks if we can't set video mode. --- 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())