| 782 | } |
| 783 | |
| 784 | void EngineGL33::ListMonitors(FindArray<MonitorInfo>& ret) |
| 785 | { |
| 786 | ret.Clear(); |
| 787 | int count = 0; |
| 788 | SDL_DisplayID* displays = SDL_GetDisplays(&count); |
| 789 | if (!displays) |
| 790 | return; |
| 791 | for (int i = 0; i < count; ++i) |
| 792 | { |
| 793 | const SDL_DisplayMode* mode = SDL_GetDesktopDisplayMode(displays[i]); |
| 794 | const char* name = SDL_GetDisplayName(displays[i]); |
| 795 | MonitorInfo info; |
| 796 | info.index = i; |
| 797 | info.name = name ? name : "Unknown"; |
| 798 | info.w = mode ? mode->w : 0; |
| 799 | info.h = mode ? mode->h : 0; |
| 800 | info.refresh = mode ? (int)(mode->refresh_rate + 0.5f) : 0; |
| 801 | ret.Add(info); |
| 802 | } |
| 803 | SDL_free(displays); |
| 804 | } |
| 805 | |
| 806 | int EngineGL33::GetCurrentMonitor() const |
| 807 | { |