aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authortaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-05-14 11:03:49 +0000
committertaw27 <taw27@84d2e878-0bd5-11dd-ad15-13eda11d74c5>2008-05-14 11:03:49 +0000
commit386384955ed68b7671f152a0ab4f30c2170e3e54 (patch)
treef3b68b1988b61cb07df5da2f026ceaabb88525b2 /src/main.c
parent9a26fd44ad9cad77b907c081184c62f5f9545a17 (diff)
Try a lower resolution if large widescreen fails
git-svn-id: svn://cook.msm.cam.ac.uk:745/thrust3d/thrust3d@9 84d2e878-0bd5-11dd-ad15-13eda11d74c5
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 7637655..36de2a3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,15 +39,20 @@ int main(int argc, char *argv[]) {
}
atexit(SDL_Quit);
- width = 1680;//1024;
- height = 1050;//768;
-
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+
+ width = 1680; height = 1050;
screen = SDL_SetVideoMode(width, height, 16, SDL_OPENGL | SDL_FULLSCREEN);
- if (screen == NULL) {
- fprintf(stderr, "Couldn't set video mode: %s\n", SDL_GetError());
- return 1;
+ if ( screen == NULL ) {
+ width = 1280; height = 1024;
+ screen = SDL_SetVideoMode(width, height, 16, SDL_OPENGL | SDL_FULLSCREEN);
+ if (screen == NULL) {
+ fprintf(stderr, "Couldn't set video mode: %s\n", SDL_GetError());
+ SDL_Quit();
+ return 1;
+ }
}
+
SDL_WM_SetCaption("Thrust3D", "Thrust3D");
SDL_ShowCursor(SDL_DISABLE);