comparison test/common.c @ 5143:e743b9c3f6d6

Making the API simpler, the blend modes are "none, blend, add" and are supported by all renderers.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 31 Jan 2011 23:23:57 -0800
parents da10636e5eca
children c8e049de174c
comparison
equal deleted inserted replaced
5142:57851a238c8f 5143:e743b9c3f6d6
355 break; 355 break;
356 } 356 }
357 } 357 }
358 358
359 static void 359 static void
360 PrintBlendMode(Uint32 flag)
361 {
362 switch (flag) {
363 case SDL_BLENDMODE_NONE:
364 fprintf(stderr, "None");
365 break;
366 case SDL_BLENDMODE_MASK:
367 fprintf(stderr, "Mask");
368 break;
369 case SDL_BLENDMODE_BLEND:
370 fprintf(stderr, "Blend");
371 break;
372 case SDL_BLENDMODE_ADD:
373 fprintf(stderr, "Add");
374 break;
375 case SDL_BLENDMODE_MOD:
376 fprintf(stderr, "Mod");
377 break;
378 default:
379 fprintf(stderr, "0x%8.8x", flag);
380 break;
381 }
382 }
383
384 static void
385 PrintPixelFormat(Uint32 format) 360 PrintPixelFormat(Uint32 format)
386 { 361 {
387 switch (format) { 362 switch (format) {
388 case SDL_PIXELFORMAT_UNKNOWN: 363 case SDL_PIXELFORMAT_UNKNOWN:
389 fprintf(stderr, "Unknwon"); 364 fprintf(stderr, "Unknwon");
496 if (info->flags & flag) { 471 if (info->flags & flag) {
497 if (count > 0) { 472 if (count > 0) {
498 fprintf(stderr, " | "); 473 fprintf(stderr, " | ");
499 } 474 }
500 PrintRendererFlag(flag); 475 PrintRendererFlag(flag);
501 ++count;
502 }
503 }
504 fprintf(stderr, ")\n");
505
506 fprintf(stderr, " Blend: 0x%8.8X", info->blend_modes);
507 fprintf(stderr, " (");
508 count = 0;
509 for (i = 0; i < sizeof(info->blend_modes) * 8; ++i) {
510 Uint32 flag = (1 << i);
511 if (info->blend_modes & flag) {
512 if (count > 0) {
513 fprintf(stderr, " | ");
514 }
515 PrintBlendMode(flag);
516 ++count; 476 ++count;
517 } 477 }
518 } 478 }
519 fprintf(stderr, ")\n"); 479 fprintf(stderr, ")\n");
520 480