test/testbitmap.c
branchgsoc2008_iphone
changeset 2431 7e449145b6ca
parent 1895 c121d94672cb
equal deleted inserted replaced
2430:166821fa1591 2431:7e449145b6ca
    65     SDL_Event event;
    65     SDL_Event event;
    66     Uint16 *buffer16;
    66     Uint16 *buffer16;
    67     Uint16 color;
    67     Uint16 color;
    68     Uint8 gradient;
    68     Uint8 gradient;
    69     SDL_Color palette[256];
    69     SDL_Color palette[256];
    70 
    70 	
    71 
    71 	int video_w, video_h;
       
    72 	
    72     /* Initialize SDL */
    73     /* Initialize SDL */
    73     if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    74     if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    74         fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
    75         fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
    75         return (1);
    76         return (1);
    76     }
    77     }
    93                     "Usage: %s [-bpp N] [-warp] [-hw] [-fullscreen]\n",
    94                     "Usage: %s [-bpp N] [-warp] [-hw] [-fullscreen]\n",
    94                     argv[0]);
    95                     argv[0]);
    95             quit(1);
    96             quit(1);
    96         }
    97         }
    97     }
    98     }
    98 
    99 	
       
   100 #ifdef __IPHONEOS__
       
   101 	video_w = 320;
       
   102 	video_h = 480;
       
   103 #else
       
   104 	video_w = 640;
       
   105 	video_h = 480;
       
   106 #endif
       
   107 	
    99     /* Set 640x480 video mode */
   108     /* Set 640x480 video mode */
   100     if ((screen = SDL_SetVideoMode(640, 480, video_bpp, videoflags)) == NULL) {
   109     if ((screen = SDL_SetVideoMode(video_w, video_h, video_bpp, videoflags)) == NULL) {
   101         fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
   110         fprintf(stderr, "Couldn't set %%d%d video mode: %s\n",
   102                 video_bpp, SDL_GetError());
   111                 video_w, video_h, video_bpp, SDL_GetError());
   103         quit(2);
   112         quit(2);
   104     }
   113     }
   105 
   114 
   106     if (video_bpp == 8) {
   115     if (video_bpp == 8) {
   107         /* Set a gray colormap, reverse order from white to black */
   116         /* Set a gray colormap, reverse order from white to black */