Skip to content

Commit

Permalink
Implemented use of FullscreenMonitorIndex setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewol committed Mar 18, 2018
1 parent 9da9f52 commit 47dbccc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Graphics/src/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,20 @@ namespace Graphics
}
else
{
if (monitorID == (uint32)-1)
{
monitorID = SDL_GetWindowDisplayIndex(m_window);
}

SDL_Rect displayRect;
SDL_GetDisplayBounds(monitorID, &displayRect);
SDL_SetWindowPosition(m_window, displayRect.x, displayRect.y);
SDL_SetWindowSize(m_window, displayRect.w, displayRect.h);

SDL_DisplayMode dm;
SDL_GetDesktopDisplayMode(monitorID, &dm);
SDL_SetWindowFullscreen(m_window, SDL_WINDOW_FULLSCREEN);
SDL_SetWindowDisplayMode(m_window, &dm);
m_fullscreen = true;
}
}
Expand Down

0 comments on commit 47dbccc

Please sign in to comment.