comparison test/testvidinfo.c @ 5281:15a71bec4a55

merged
author Eric Wing <ewing . public |-at-| gmail . com>
date Sat, 12 Feb 2011 19:16:09 -0800
parents 762e40fb8e28
children
comparison
equal deleted inserted replaced
5219:adfcdd311ae0 5281:15a71bec4a55
453 453
454 SDL_GetDisplayBounds(d, &bounds); 454 SDL_GetDisplayBounds(d, &bounds);
455 printf("Display %d: %dx%d at %d,%d\n", d, 455 printf("Display %d: %dx%d at %d,%d\n", d,
456 bounds.w, bounds.h, bounds.x, bounds.y); 456 bounds.w, bounds.h, bounds.x, bounds.y);
457 457
458 SDL_SelectVideoDisplay(d); 458 SDL_GetDesktopDisplayMode(d, &mode);
459
460 SDL_GetDesktopDisplayMode(&mode);
461 SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask, &Bmask, 459 SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask, &Bmask,
462 &Amask); 460 &Amask);
463 printf(" Current mode: %dx%d@%dHz, %d bits-per-pixel\n", mode.w, 461 printf(" Current mode: %dx%d@%dHz, %d bits-per-pixel\n", mode.w,
464 mode.h, mode.refresh_rate, bpp); 462 mode.h, mode.refresh_rate, bpp);
465 if (Rmask || Gmask || Bmask) { 463 if (Rmask || Gmask || Bmask) {
469 if (Amask) 467 if (Amask)
470 printf(" Alpha Mask = 0x%.8x\n", Amask); 468 printf(" Alpha Mask = 0x%.8x\n", Amask);
471 } 469 }
472 470
473 /* Print available fullscreen video modes */ 471 /* Print available fullscreen video modes */
474 nmodes = SDL_GetNumDisplayModes(); 472 nmodes = SDL_GetNumDisplayModes(d);
475 if (nmodes == 0) { 473 if (nmodes == 0) {
476 printf("No available fullscreen video modes\n"); 474 printf("No available fullscreen video modes\n");
477 } else { 475 } else {
478 printf(" Fullscreen video modes:\n"); 476 printf(" Fullscreen video modes:\n");
479 for (i = 0; i < nmodes; ++i) { 477 for (i = 0; i < nmodes; ++i) {
480 SDL_GetDisplayMode(i, &mode); 478 SDL_GetDisplayMode(d, i, &mode);
481 SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, 479 SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask,
482 &Gmask, &Bmask, &Amask); 480 &Gmask, &Bmask, &Amask);
483 printf(" Mode %d: %dx%d@%dHz, %d bits-per-pixel\n", i, 481 printf(" Mode %d: %dx%d@%dHz, %d bits-per-pixel\n", i,
484 mode.w, mode.h, mode.refresh_rate, bpp); 482 mode.w, mode.h, mode.refresh_rate, bpp);
485 if (Rmask || Gmask || Bmask) { 483 if (Rmask || Gmask || Bmask) {