Add video settings UI and refresh loading assets

This commit is contained in:
Kelsi 2026-02-05 16:11:00 -08:00
parent 77070468b5
commit 6a49a7e01f
9 changed files with 150 additions and 2 deletions

View file

@ -37,6 +37,11 @@ public:
int getHeight() const { return height; }
void setSize(int w, int h) { width = w; height = h; }
float getAspectRatio() const { return static_cast<float>(width) / height; }
bool isFullscreen() const { return fullscreen; }
bool isVsyncEnabled() const { return vsync; }
void setFullscreen(bool enable);
void setVsync(bool enable);
void applyResolution(int w, int h);
SDL_Window* getSDLWindow() const { return window; }
SDL_GLContext getGLContext() const { return glContext; }
@ -48,6 +53,10 @@ private:
int width;
int height;
int windowedWidth = 0;
int windowedHeight = 0;
bool fullscreen = false;
bool vsync = true;
bool shouldCloseFlag = false;
};

View file

@ -55,6 +55,11 @@ private:
bool showTeleporter = false;
bool showEscapeMenu = false;
bool showEscapeSettingsNotice = false;
bool showSettingsWindow = false;
bool settingsInit = false;
bool pendingFullscreen = false;
bool pendingVsync = false;
int pendingResIndex = 0;
/**
* Render player info window
@ -124,6 +129,7 @@ private:
void renderVendorWindow(game::GameHandler& gameHandler);
void renderTeleporterPanel();
void renderEscapeMenu();
void renderSettingsWindow();
/**
* Inventory screen