17#include <unordered_map>
19#include <unordered_set>
26#define SDL_MAIN_HANDLED
89 SDL_Window *m_p_window;
91 glm::uvec2 m_windowResolution;
92 glm::uvec2 m_renderResolution;
93 float m_upscaleRatio = 1.0f;
void setMode(ResolutionMode mode)
Function to set the resolution mode. It is called by engine method.
ResolutionManager(SDL_Window *p_window)
Constructor.
float getUpscaleRatio() const
Function to get the current upscale ratio. Read window resolution divided by render resolution.
void calculatePS1SharpResolution()
Internal helper to calculate integer-scaled resolutions for the PS1_SHARP mode.
glm::uvec2 getWindowResolution() const
Function to get the current window resolution.
ResolutionMode getCurrentMode() const
Function to get the current resolution mode.
float getPotencialUpscaleRatio()
Calculates the potential upscale ratio for a given height. @description allows you to create consista...
glm::uvec2 getRenderResolution() const
Function to get the current render resolution.
void update()
Updates the internal resolution state based on the current window size and mode.
This class esentially abstracts SDL_Window.
ResolutionMode
Enumeration representing different resolution modes.
@ PS1_SHARP
Integer-scaled resolution closest to PS1.
@ RES_240P
240p (426x240 for 16:9).
@ NATIVE
Use window resolution.
@ RES_480P
480p (854x480 for 16:9).