SDL: Use the window display index when querying display modes

This commit is contained in:
SupSuper 2021-04-29 05:18:37 +01:00 committed by Filippos Karapetis
parent 41798fca5d
commit 60f1fd98aa
6 changed files with 27 additions and 33 deletions

View file

@ -140,10 +140,11 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager(SdlEventSource *eventSource,
// Retrieve a list of working fullscreen modes
#if SDL_VERSION_ATLEAST(2, 0, 0)
const int numModes = SDL_GetNumDisplayModes(0);
const int display = _window->getDisplayIndex();
const int numModes = SDL_GetNumDisplayModes(display);
for (int i = 0; i < numModes; ++i) {
SDL_DisplayMode mode;
if (SDL_GetDisplayMode(0, i, &mode)) {
if (SDL_GetDisplayMode(display, i, &mode)) {
continue;
}