| 633 | }; // namespace Wisp |
| 634 | |
| 635 | void GetDisplaySize(int *x, int *y) |
| 636 | { |
| 637 | #if SDL_VERSION_ATLEAST(2, 0, 5) |
| 638 | SDL_Rect r; |
| 639 | SDL_GetDisplayUsableBounds(0, &r); |
| 640 | if (x != nullptr) |
| 641 | { |
| 642 | *x = r.w; |
| 643 | } |
| 644 | if (y != nullptr) |
| 645 | { |
| 646 | *y = r.h; |
| 647 | } |
| 648 | #else |
| 649 | SDL_DisplayMode dm; |
| 650 | SDL_GetCurrentDisplayMode(0, &dm); |
| 651 | if (x != nullptr) |
| 652 | { |
| 653 | *x = dm.w; |
| 654 | } |
| 655 | if (y != nullptr) |
| 656 | { |
| 657 | *y = dm.h; |
| 658 | } |
| 659 | #endif |
| 660 | } |
no test coverage detected