ge211
ge211_window.h
1 #pragma once
2 
3 #include "ge211_forward.h"
4 #include "ge211_geometry.h"
5 #include "ge211_util.h"
6 
7 #include <string>
8 
9 namespace ge211 {
10 
12 class Window
13 {
14 public:
16  Dimensions get_dimensions() const noexcept;
20 
23  Position get_position() const noexcept;
26  void set_position(Position);
29  static const Position centered;
30 
37  const char* get_title() const noexcept;
39  void set_title(const std::string&) noexcept;
40 
42  bool get_resizeable() const noexcept;
44  void set_resizeable(bool) noexcept;
45 
47  bool get_fullscreen() const noexcept;
50  void set_fullscreen(bool);
51 
55  Dimensions max_window_dimensions() const noexcept;
56 
60  static Dimensions max_fullscreen_dimensions() noexcept;
61 
62 private:
63  friend detail::Engine;
64  friend detail::Renderer;
65 
66  Window(const std::string&, Dimensions dim);
67 
68  SDL_Window* get_raw_() const noexcept { return ptr_.get(); }
69  uint32_t get_flags_() const noexcept;
70 
71  detail::delete_ptr<SDL_Window> ptr_;
72 };
73 
74 }
static Dimensions max_fullscreen_dimensions() noexcept
Returns the maximum dimensions for a fullscreen window.
void set_position(Position)
Sets the position of the upper-left corner of the window with respect to the upper-left corner of the...
The game engine namespace.
Definition: ge211.h:17
void set_title(const std::string &) noexcept
Changes the title of this window.
Dimensions get_dimensions() const noexcept
Returns the current dimensions of this window.
static const Position centered
A special value to pass to set_position(Position) to center the window on the screen.
Definition: ge211_window.h:29
Position get_position() const noexcept
Gets the position of the upper-left corner of the window with respect to the upper-left corner of the...
Provides access to the game window and its properties.
Definition: ge211_window.h:12
Dimensions max_window_dimensions() const noexcept
Returns the maximum dimensions for a non-fullscreen window.
Represents the dimensions of an object, or more generally, the displacement between two Basic_positio...
Definition: ge211_forward.h:73
A position in the T-valued Cartesian plane.
Definition: ge211_forward.h:74
bool get_fullscreen() const noexcept
Returns whether the program is in fullscreen mode.
const char * get_title() const noexcept
Returns the current title of this window.
void set_resizeable(bool) noexcept
Changes whether the user can resize this window.
bool get_resizeable() const noexcept
Returns whether the user can resize this window.
void set_dimensions(Dimensions)
Changes the size of the window.
void set_fullscreen(bool)
Sets whether the program should be in fullscreen mode.