mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-26 20:31:41 +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;
|
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)
|
void GameWindow::SetDimensions(int w, int h, int x, int y)
|
||||||
{
|
{
|
||||||
s_width = w;
|
s_width = w;
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ public:
|
||||||
static bool IsMaximised();
|
static bool IsMaximised();
|
||||||
static EWindowState SetMaximised(bool isEnabled);
|
static EWindowState SetMaximised(bool isEnabled);
|
||||||
static SDL_Rect GetDimensions();
|
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 SetDimensions(int w, int h, int x = SDL_WINDOWPOS_CENTERED, int y = SDL_WINDOWPOS_CENTERED);
|
||||||
static void ResetDimensions();
|
static void ResetDimensions();
|
||||||
static uint32_t GetWindowFlags();
|
static uint32_t GetWindowFlags();
|
||||||
|
|
|
||||||
|
|
@ -1120,9 +1120,16 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
|
||||||
else if constexpr (std::is_same_v<T, int32_t>)
|
else if constexpr (std::is_same_v<T, int32_t>)
|
||||||
{
|
{
|
||||||
if (config == &Config::WindowSize)
|
if (config == &Config::WindowSize)
|
||||||
|
{
|
||||||
|
if (Config::Fullscreen)
|
||||||
|
{
|
||||||
|
int displayW, displayH;
|
||||||
|
GameWindow::GetSizeInPixels(&displayW, &displayH);
|
||||||
|
valueText = fmt::format("{}x{}", displayW, displayH);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
auto displayModes = GameWindow::GetDisplayModes();
|
auto displayModes = GameWindow::GetDisplayModes();
|
||||||
|
|
||||||
if (config->Value >= 0 && config->Value < displayModes.size())
|
if (config->Value >= 0 && config->Value < displayModes.size())
|
||||||
{
|
{
|
||||||
auto& displayMode = displayModes[config->Value];
|
auto& displayMode = displayModes[config->Value];
|
||||||
|
|
@ -1134,6 +1141,7 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
|
||||||
valueText = fmt::format("{}x{}", GameWindow::s_width, GameWindow::s_height);
|
valueText = fmt::format("{}x{}", GameWindow::s_width, GameWindow::s_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (config == &Config::Monitor)
|
else if (config == &Config::Monitor)
|
||||||
{
|
{
|
||||||
valueText = fmt::format("{}", config->Value + 1);
|
valueText = fmt::format("{}", config->Value + 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue