From c7c3bb8d304ead3ae5ab94018a2f952f9796ecc4 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 30 May 2007 22:52:44 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1034 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/main.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/src/main.cpp b/source/src/main.cpp index 8e3fadd5..d785a865 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -37,8 +37,8 @@ void fatal(char *s, char *o) // failure exit exit(EXIT_FAILURE); } -int scr_w = 640; -int scr_h = 480; +int scr_w = 1024; +int scr_h = 768; int VIRTW; void screenshot(char *imagepath) @@ -228,6 +228,16 @@ int main(int argc, char **argv) #if defined(WIN32) || defined(__APPLE__) resize = 0; #endif + SDL_Rect **modes = SDL_ListModes(NULL, SDL_OPENGL|resize|fs); + if(modes && modes!=(SDL_Rect **)-1) + { + bool hasmode = false; + for(int i = 0; modes[i]; i++) + { + if(scr_w <= modes[i]->w && scr_h <= modes[i]->h) { hasmode = true; break; } + } + if(!hasmode) { scr_w = modes[0]->w; scr_h = modes[0]->h; } + } screen = SDL_SetVideoMode(scr_w, scr_h, bpp, SDL_OPENGL|resize|fs); if(screen==NULL) fatal("Unable to create OpenGL screen"); fullscreen = fs!=0;