From d304ee8b3f7f3fe794553f540ac9c8387fbcbfa7 Mon Sep 17 00:00:00 2001 From: Holmes Futrell Date: Fri, 15 Aug 2008 00:56:43 +0000 Subject: [PATCH] Added some code to set proper screensize on iPhone --- test/testbitmap.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/test/testbitmap.c b/test/testbitmap.c index 50b569f40..433b36673 100644 --- a/test/testbitmap.c +++ b/test/testbitmap.c @@ -67,8 +67,9 @@ main(int argc, char *argv[]) Uint16 color; Uint8 gradient; SDL_Color palette[256]; - - + + int video_w, video_h; + /* Initialize SDL */ if (SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); @@ -95,11 +96,19 @@ main(int argc, char *argv[]) quit(1); } } - + +#ifdef __IPHONEOS__ + video_w = 320; + video_h = 480; +#else + video_w = 640; + video_h = 480; +#endif + /* Set 640x480 video mode */ - if ((screen = SDL_SetVideoMode(640, 480, video_bpp, videoflags)) == NULL) { - fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", - video_bpp, SDL_GetError()); + if ((screen = SDL_SetVideoMode(video_w, video_h, video_bpp, videoflags)) == NULL) { + fprintf(stderr, "Couldn't set %%d%d video mode: %s\n", + video_w, video_h, video_bpp, SDL_GetError()); quit(2); }