Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added some code to set proper screensize on iPhone
Browse files Browse the repository at this point in the history
  • Loading branch information
Holmes Futrell committed Aug 15, 2008
1 parent 12bec43 commit d304ee8
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions test/testbitmap.c
Expand Up @@ -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());
Expand All @@ -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);
}

Expand Down

0 comments on commit d304ee8

Please sign in to comment.