Mercurial > sdl-ios-xcode
comparison test/common.c @ 1967:01e29c3e9a29
In general, fill in pointers to structures, rather than return them.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 05 Aug 2006 22:34:23 +0000 |
parents | a788656ca29a |
children | 5d3724f64f2b |
comparison
equal
deleted
inserted
replaced
1966:6472256c21eb | 1967:01e29c3e9a29 |
---|---|
543 fprintf(stderr, "Video driver: %s\n", | 543 fprintf(stderr, "Video driver: %s\n", |
544 SDL_GetCurrentVideoDriver()); | 544 SDL_GetCurrentVideoDriver()); |
545 } | 545 } |
546 | 546 |
547 if (state->verbose & VERBOSE_MODES) { | 547 if (state->verbose & VERBOSE_MODES) { |
548 const SDL_DisplayMode *mode; | 548 SDL_DisplayMode mode; |
549 int bpp; | 549 int bpp; |
550 Uint32 Rmask, Gmask, Bmask, Amask; | 550 Uint32 Rmask, Gmask, Bmask, Amask; |
551 | 551 |
552 n = SDL_GetNumVideoDisplays(); | 552 n = SDL_GetNumVideoDisplays(); |
553 fprintf(stderr, "Number of displays: %d\n", n); | 553 fprintf(stderr, "Number of displays: %d\n", n); |
554 for (i = 0; i < n; ++i) { | 554 for (i = 0; i < n; ++i) { |
555 fprintf(stderr, "Display %d:\n", i); | 555 fprintf(stderr, "Display %d:\n", i); |
556 SDL_SelectVideoDisplay(i); | 556 SDL_SelectVideoDisplay(i); |
557 | 557 |
558 mode = SDL_GetDesktopDisplayMode(); | 558 SDL_GetDesktopDisplayMode(&mode); |
559 SDL_PixelFormatEnumToMasks(mode->format, &bpp, &Rmask, &Gmask, | 559 SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, &Gmask, |
560 &Bmask, &Amask); | 560 &Bmask, &Amask); |
561 fprintf(stderr, | 561 fprintf(stderr, |
562 " Current mode: %dx%d@%dHz, %d bits-per-pixel\n", | 562 " Current mode: %dx%d@%dHz, %d bits-per-pixel\n", |
563 mode->w, mode->h, mode->refresh_rate, bpp); | 563 mode.w, mode.h, mode.refresh_rate, bpp); |
564 if (Rmask || Gmask || Bmask) { | 564 if (Rmask || Gmask || Bmask) { |
565 fprintf(stderr, " Red Mask = 0x%.8x\n", Rmask); | 565 fprintf(stderr, " Red Mask = 0x%.8x\n", Rmask); |
566 fprintf(stderr, " Green Mask = 0x%.8x\n", Gmask); | 566 fprintf(stderr, " Green Mask = 0x%.8x\n", Gmask); |
567 fprintf(stderr, " Blue Mask = 0x%.8x\n", Bmask); | 567 fprintf(stderr, " Blue Mask = 0x%.8x\n", Bmask); |
568 if (Amask) | 568 if (Amask) |
574 if (m == 0) { | 574 if (m == 0) { |
575 fprintf(stderr, "No available fullscreen video modes\n"); | 575 fprintf(stderr, "No available fullscreen video modes\n"); |
576 } else { | 576 } else { |
577 fprintf(stderr, " Fullscreen video modes:\n"); | 577 fprintf(stderr, " Fullscreen video modes:\n"); |
578 for (j = 0; j < m; ++j) { | 578 for (j = 0; j < m; ++j) { |
579 mode = SDL_GetDisplayMode(j); | 579 SDL_GetDisplayMode(j, &mode); |
580 SDL_PixelFormatEnumToMasks(mode->format, &bpp, &Rmask, | 580 SDL_PixelFormatEnumToMasks(mode.format, &bpp, &Rmask, |
581 &Gmask, &Bmask, &Amask); | 581 &Gmask, &Bmask, &Amask); |
582 fprintf(stderr, | 582 fprintf(stderr, |
583 " Mode %d: %dx%d@%dHz, %d bits-per-pixel\n", | 583 " Mode %d: %dx%d@%dHz, %d bits-per-pixel\n", |
584 j, mode->w, mode->h, mode->refresh_rate, bpp); | 584 j, mode.w, mode.h, mode.refresh_rate, bpp); |
585 if (Rmask || Gmask || Bmask) { | 585 if (Rmask || Gmask || Bmask) { |
586 fprintf(stderr, " Red Mask = 0x%.8x\n", | 586 fprintf(stderr, " Red Mask = 0x%.8x\n", |
587 Rmask); | 587 Rmask); |
588 fprintf(stderr, " Green Mask = 0x%.8x\n", | 588 fprintf(stderr, " Green Mask = 0x%.8x\n", |
589 Gmask); | 589 Gmask); |