Skip to content

Commit

Permalink
SDL_GetDisplayBounds
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtBagXon committed May 23, 2024
1 parent fdbbec5 commit 391ec44
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Src/OSD/SDL/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,19 @@ int Supermodel(const Game &game, ROMSet *rom_set, IEmulator *Model3, CInputs *In
char titleStr[128];
totalXRes = xRes = s_runtime_config["XResolution"].ValueAs<unsigned>();
totalYRes = yRes = s_runtime_config["YResolution"].ValueAs<unsigned>();
bool fullscreen = s_runtime_config["FullScreen"].ValueAs<bool>();
if (fullscreen) {
SDL_Rect g_logical_rect = {0, 0, 0, 0};
SDL_GetDisplayBounds(0, &g_logical_rect);
totalXRes = g_logical_rect.w;
totalYRes = g_logical_rect.h;
}
sprintf(baseTitleStr, "Supermodel - %s", game.title.c_str());
SDL_SetWindowTitle(s_window, baseTitleStr);
SDL_SetWindowSize(s_window, totalXRes, totalYRes);
SDL_SetWindowPosition(s_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
bool stretch = s_runtime_config["Stretch"].ValueAs<bool>();
bool fullscreen = s_runtime_config["FullScreen"].ValueAs<bool>();

if (OKAY != ResizeGLScreen(&xOffset, &yOffset ,&xRes, &yRes, &totalXRes, &totalYRes, !stretch, fullscreen))
return 1;

Expand Down

0 comments on commit 391ec44

Please sign in to comment.