VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
Window.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
9#define SDL_MAIN_HANDLED
10#include <SDL3/SDL.h>
11#include <SDL3/SDL_main.h>
12#include <iostream>
13
14#include "components/ErrorUtils.hpp"
15
16namespace vex {
18 class Window{
19 private:
20 SDL_Window *window;
21 bool done = false;
22
30 static constexpr Uint64 FULLSCREEN_DEBOUNCE_MS = 100;
31 public:
40 Window(std::string title, int resx = 480, int resy = 640);
41 ~Window();
42
45 SDL_Window* GetSDLWindow();
46
56 void setFullscreen(bool enabled, bool exclusive = false);
57
60 bool isFullscreen();
61
65 float getRefreshRate();
66 };
67}
bool isFullscreen()
Getter for fullscreen mode.
Definition Window.cpp:102
bool m_cachedExclusiveMode
Cached exclusive mode setting.
Definition Window.hpp:26
float getRefreshRate()
Gets the refresh rate of the display the window is currently on.
Definition Window.cpp:106
void setFullscreen(bool enabled, bool exclusive=false)
Setter for fullscreen mode.
Definition Window.cpp:50
SDL_Window * GetSDLWindow()
Getter for SDL_Window pointer.
Definition Window.cpp:46
static constexpr Uint64 FULLSCREEN_DEBOUNCE_MS
Debounce interval in milliseconds to prevent rapid fullscreen toggles.
Definition Window.hpp:30
Window(std::string title, int resx=480, int resy=640)
Constructor for Window class.
Definition Window.cpp:4
Uint64 m_lastFullscreenChangeTime
Timestamp of last fullscreen state change (in SDL performance counter units).
Definition Window.hpp:28
bool m_cachedFullscreenState
Cached fullscreen state to prevent redundant SDL calls.
Definition Window.hpp:24