| 825 | } |
| 826 | |
| 827 | bool EngineGL33::SwitchMonitor(int idx) |
| 828 | { |
| 829 | if (!_sdlWindow) |
| 830 | return false; |
| 831 | int count = 0; |
| 832 | SDL_DisplayID* displays = SDL_GetDisplays(&count); |
| 833 | if (!displays || idx < 0 || idx >= count) |
| 834 | { |
| 835 | SDL_free(displays); |
| 836 | return false; |
| 837 | } |
| 838 | SDL_DisplayID target = displays[idx]; |
| 839 | SDL_free(displays); |
| 840 | SDL_Rect bounds; |
| 841 | if (!SDL_GetDisplayBounds(target, &bounds)) |
| 842 | return false; |
| 843 | int windowW = _w; |
| 844 | int windowH = _h; |
| 845 | SDL_GetWindowSize(_sdlWindow, &windowW, &windowH); |
| 846 | SDL_SetWindowPosition(_sdlWindow, bounds.x + (bounds.w - windowW) / 2, bounds.y + (bounds.h - windowH) / 2); |
| 847 | return true; |
| 848 | } |
| 849 | |
| 850 | bool EngineGL33::GetDesktopDisplayMode(int& w, int& h, int& refresh) const |
| 851 | { |
no outgoing calls
no test coverage detected