mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-25 20:01:58 +00:00
Show window size in pixels while in Fullscreen mode.
This commit is contained in:
parent
90a3a9f371
commit
40c947c47e
3 changed files with 21 additions and 7 deletions
|
|
@ -378,6 +378,11 @@ SDL_Rect GameWindow::GetDimensions()
|
|||
return rect;
|
||||
}
|
||||
|
||||
void GameWindow::GetSizeInPixels(int *w, int *h)
|
||||
{
|
||||
SDL_GetWindowSizeInPixels(s_pWindow, w, h);
|
||||
}
|
||||
|
||||
void GameWindow::SetDimensions(int w, int h, int x, int y)
|
||||
{
|
||||
s_width = w;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ public:
|
|||
static bool IsMaximised();
|
||||
static EWindowState SetMaximised(bool isEnabled);
|
||||
static SDL_Rect GetDimensions();
|
||||
static void GetSizeInPixels(int *w, int *h);
|
||||
static void SetDimensions(int w, int h, int x = SDL_WINDOWPOS_CENTERED, int y = SDL_WINDOWPOS_CENTERED);
|
||||
static void ResetDimensions();
|
||||
static uint32_t GetWindowFlags();
|
||||
|
|
|
|||
|
|
@ -1121,17 +1121,25 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
|
|||
{
|
||||
if (config == &Config::WindowSize)
|
||||
{
|
||||
auto displayModes = GameWindow::GetDisplayModes();
|
||||
|
||||
if (config->Value >= 0 && config->Value < displayModes.size())
|
||||
if (Config::Fullscreen)
|
||||
{
|
||||
auto& displayMode = displayModes[config->Value];
|
||||
|
||||
valueText = fmt::format("{}x{}", displayMode.w, displayMode.h);
|
||||
int displayW, displayH;
|
||||
GameWindow::GetSizeInPixels(&displayW, &displayH);
|
||||
valueText = fmt::format("{}x{}", displayW, displayH);
|
||||
}
|
||||
else
|
||||
{
|
||||
valueText = fmt::format("{}x{}", GameWindow::s_width, GameWindow::s_height);
|
||||
auto displayModes = GameWindow::GetDisplayModes();
|
||||
if (config->Value >= 0 && config->Value < displayModes.size())
|
||||
{
|
||||
auto& displayMode = displayModes[config->Value];
|
||||
|
||||
valueText = fmt::format("{}x{}", displayMode.w, displayMode.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
valueText = fmt::format("{}x{}", GameWindow::s_width, GameWindow::s_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (config == &Config::Monitor)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue