This class esentially abstracts SDL_Window. More...
#include <Window.hpp>
Public Member Functions | |
| Window (std::string title, int resx=480, int resy=640) | |
| Constructor for Window class. | |
| SDL_Window * | GetSDLWindow () |
| Getter for SDL_Window pointer. | |
| void | setFullscreen (bool enabled, bool exclusive=false) |
| Setter for fullscreen mode. | |
| bool | isFullscreen () |
| Getter for fullscreen mode. | |
| float | getRefreshRate () |
| Gets the refresh rate of the display the window is currently on. | |
Private Attributes | |
| SDL_Window * | window |
| bool | done = false |
| bool | m_cachedFullscreenState = false |
| Cached fullscreen state to prevent redundant SDL calls. | |
| bool | m_cachedExclusiveMode = false |
| Cached exclusive mode setting. | |
| Uint64 | m_lastFullscreenChangeTime = 0 |
| Timestamp of last fullscreen state change (in SDL performance counter units). | |
Static Private Attributes | |
| static constexpr Uint64 | FULLSCREEN_DEBOUNCE_MS = 100 |
| Debounce interval in milliseconds to prevent rapid fullscreen toggles. | |
This class esentially abstracts SDL_Window.
Definition at line 18 of file Window.hpp.
| vex::Window::Window | ( | std::string | title, |
| int | resx = 480, | ||
| int | resy = 640 ) |
Constructor for Window class.
Initializes SDL with Video and Gamepad subsystems.
| std::runtime_error | - If SDL initialization or Window creation fails. |
| std::string | title - Title of the window. |
| int | resx - Width of the window in pixels (default: 480). |
| int | resy - Height of the window in pixels (default: 640). |
Definition at line 4 of file Window.cpp.
| vex::Window::~Window | ( | ) |
Definition at line 39 of file Window.cpp.
| float vex::Window::getRefreshRate | ( | ) |
Gets the refresh rate of the display the window is currently on.
Queries SDL_GetDisplayForWindow followed by SDL_GetCurrentDisplayMode.
Definition at line 106 of file Window.cpp.
| SDL_Window * vex::Window::GetSDLWindow | ( | ) |
| bool vex::Window::isFullscreen | ( | ) |
Getter for fullscreen mode.
Definition at line 102 of file Window.cpp.
| void vex::Window::setFullscreen | ( | bool | enabled, |
| bool | exclusive = false ) |
Setter for fullscreen mode.
| bool | enabled - True to enable fullscreen, false to disable. |
| bool | exclusive - True for exclusive fullscreen (changes video mode), false for borderless windowed |
Definition at line 50 of file Window.cpp.
|
private |
Definition at line 21 of file Window.hpp.
|
staticconstexprprivate |
Debounce interval in milliseconds to prevent rapid fullscreen toggles.
Definition at line 30 of file Window.hpp.
|
private |
Cached exclusive mode setting.
Definition at line 26 of file Window.hpp.
|
private |
Cached fullscreen state to prevent redundant SDL calls.
Definition at line 24 of file Window.hpp.
|
private |
Timestamp of last fullscreen state change (in SDL performance counter units).
Definition at line 28 of file Window.hpp.
|
private |
Definition at line 20 of file Window.hpp.