| 249 | } |
| 250 | |
| 251 | int |
| 252 | main(int argc, char *argv[]) |
| 253 | { |
| 254 | int i; |
| 255 | int frames; |
| 256 | Uint32 then, now; |
| 257 | |
| 258 | /* Enable standard application logging */ |
| 259 | SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); |
| 260 | |
| 261 | /* Initialize test framework */ |
| 262 | state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); |
| 263 | if (!state) { |
| 264 | return 1; |
| 265 | } |
| 266 | for (i = 1; i < argc;) { |
| 267 | int consumed; |
| 268 | |
| 269 | consumed = SDLTest_CommonArg(state, i); |
| 270 | if (consumed == 0) { |
| 271 | consumed = -1; |
| 272 | if (SDL_strcasecmp(argv[i], "--composite") == 0) { |
| 273 | test_composite = SDL_TRUE; |
| 274 | consumed = 1; |
| 275 | } |
| 276 | } |
| 277 | if (consumed < 0) { |
| 278 | static const char *options[] = { "[--composite]", NULL }; |
| 279 | SDLTest_CommonLogUsage(state, argv[0], options); |
| 280 | quit(1); |
| 281 | } |
| 282 | i += consumed; |
| 283 | } |
| 284 | if (!SDLTest_CommonInit(state)) { |
| 285 | quit(2); |
| 286 | } |
| 287 | |
| 288 | drawstates = SDL_stack_alloc(DrawState, state->num_windows); |
| 289 | for (i = 0; i < state->num_windows; ++i) { |
| 290 | DrawState *drawstate = &drawstates[i]; |
| 291 | |
| 292 | drawstate->window = state->windows[i]; |
| 293 | drawstate->renderer = state->renderers[i]; |
| 294 | if (test_composite) { |
| 295 | drawstate->sprite = LoadTexture(drawstate->renderer, "icon-alpha.bmp", SDL_TRUE); |
| 296 | } else { |
| 297 | drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", SDL_TRUE); |
| 298 | } |
| 299 | drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", SDL_FALSE); |
| 300 | if (!drawstate->sprite || !drawstate->background) { |
| 301 | quit(2); |
| 302 | } |
| 303 | SDL_QueryTexture(drawstate->sprite, NULL, NULL, |
| 304 | &drawstate->sprite_rect.w, &drawstate->sprite_rect.h); |
| 305 | drawstate->scale_direction = 1; |
| 306 | } |
| 307 | |
| 308 | /* Main render loop */ |
nothing calls this directly
no test coverage detected