Added some code to set proper screensize on iPhone gsoc2008_iphone
authorHolmes Futrell <hfutrell@umail.ucsb.edu>
Fri, 15 Aug 2008 00:56:43 +0000
branchgsoc2008_iphone
changeset 24317e449145b6ca
parent 2430 166821fa1591
child 2432 daf3baf72a45
Added some code to set proper screensize on iPhone
test/testbitmap.c
     1.1 --- a/test/testbitmap.c	Fri Aug 15 00:54:21 2008 +0000
     1.2 +++ b/test/testbitmap.c	Fri Aug 15 00:56:43 2008 +0000
     1.3 @@ -67,8 +67,9 @@
     1.4      Uint16 color;
     1.5      Uint8 gradient;
     1.6      SDL_Color palette[256];
     1.7 -
     1.8 -
     1.9 +	
    1.10 +	int video_w, video_h;
    1.11 +	
    1.12      /* Initialize SDL */
    1.13      if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    1.14          fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
    1.15 @@ -95,11 +96,19 @@
    1.16              quit(1);
    1.17          }
    1.18      }
    1.19 -
    1.20 +	
    1.21 +#ifdef __IPHONEOS__
    1.22 +	video_w = 320;
    1.23 +	video_h = 480;
    1.24 +#else
    1.25 +	video_w = 640;
    1.26 +	video_h = 480;
    1.27 +#endif
    1.28 +	
    1.29      /* Set 640x480 video mode */
    1.30 -    if ((screen = SDL_SetVideoMode(640, 480, video_bpp, videoflags)) == NULL) {
    1.31 -        fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
    1.32 -                video_bpp, SDL_GetError());
    1.33 +    if ((screen = SDL_SetVideoMode(video_w, video_h, video_bpp, videoflags)) == NULL) {
    1.34 +        fprintf(stderr, "Couldn't set %%d%d video mode: %s\n",
    1.35 +                video_w, video_h, video_bpp, SDL_GetError());
    1.36          quit(2);
    1.37      }
    1.38