comparison test/testbitmap.c @ 2765:f55c87ae336b

Final merge of Google Summer of Code 2008 work... Bring SDL to iPhone and iPod Touch by Holmes Futrell, mentored by Sam Lantinga
author Sam Lantinga <slouken@libsdl.org>
date Sat, 04 Oct 2008 06:46:59 +0000
parents c121d94672cb
children c0ce3380742d
comparison
equal deleted inserted replaced
2764:4868c0df2e83 2765:f55c87ae336b
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 int video_w, video_h;
71 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);
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 =
101 fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n", 110 SDL_SetVideoMode(video_w, video_h, video_bpp, videoflags)) == NULL) {
102 video_bpp, SDL_GetError()); 111 fprintf(stderr, "Couldn't set %%d%d video mode: %s\n", video_w,
112 video_h, video_bpp, SDL_GetError());
103 quit(2); 113 quit(2);
104 } 114 }
105 115
106 if (video_bpp == 8) { 116 if (video_bpp == 8) {
107 /* Set a gray colormap, reverse order from white to black */ 117 /* Set a gray colormap, reverse order from white to black */