-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
window.h
32 lines (25 loc) · 1.19 KB
/
window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef WINDOW_H
#define WINDOW_H
#include <memory>
#include "sdl-wrapper.h"
#include "debug-log.h"
class Window
{
public:
SDL::Window sdl_window;
SDL::Renderer renderer;
SDL::Texture framebuffer_texture;
Window(DebugLog &debug_log, const char *window_title, int window_width, int window_height, int framebuffer_width, int framebuffer_height);
float GetDPIScale() const;
void SetFullscreen(bool enabled) { SDL_SetWindowFullscreen(GetSDLWindow(), enabled ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); }
bool GetFullscreen() const { return (SDL_GetWindowFlags(GetSDLWindow()) & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP)) != 0; }
void ToggleFullscreen() { SetFullscreen(!GetFullscreen()); }
SDL_Window* GetSDLWindow() const { return sdl_window.get(); }
SDL_Renderer* GetRenderer() const { return renderer.get(); }
SDL_Texture* GetFramebufferTexture() const { return framebuffer_texture.get(); }
void SetTitleBarColour(unsigned char red, unsigned char green, unsigned char blue);
void ShowWarningMessageBox(const char *message) const;
void ShowErrorMessageBox(const char *message) const;
void ShowFatalMessageBox(const char *message) const;
};
#endif /* WINDOW_H */