Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
window.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4
5class SDL_Window; // forward declaration to keep SDL include out of headers
6
15class Window {
16 private:
17 unsigned min_width_;
18 unsigned min_height_;
19
20 // I tried using an std::optional<std::reference_wrapper<SDL_Window>> here.
21 // But optional requires a type know at compile time due to how the optional
22 // template is implemented. SDL_Window * const can not be done here because
23 // init still has to be able to change its value.
24 SDL_Window* window_;
25
26 friend class Renderer;
27 Window& init(SDL_Window* window);
28
29 public:
30 explicit Window(unsigned min_width, unsigned min_height);
31
38 Window& set_window_width(unsigned width);
39 Window& set_window_height(unsigned height);
40
42 int get_window_width() const;
43
45 int get_window_height() const;
46};
Service responsible for rendering game objects to the screen.
Definition renderer.h:25
Represents the game window and provides methods to modify its properties. The window encapsulates an ...
Definition window.h:15
int get_window_width() const
Gets the current width of the window.
Window & set_window_width(unsigned width)
Window(unsigned min_width, unsigned min_height)
Window & set_window_windowed()
Window & set_window_resizable()
Window & set_window_bordered()
Window & set_window_height(unsigned height)
Window & set_window_unresizable()
Window & set_window_fullscreen()
Window & set_window_borderless()
int get_window_height() const
Gets the current height of the window.