galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
WindowBindable.cpp
Go to the documentation of this file.
1
7
8#include <entt/locator/locator.hpp>
9
11
12#include "WindowBindable.hpp"
13
14namespace galaxy
15{
17 : m_window {nullptr}
18 {
19 bind_window();
20 }
21
23 {
24 this->m_window = w.m_window;
25 w.m_window = nullptr;
26 }
27
29 {
30 if (this != &w)
31 {
32 this->m_window = w.m_window;
33 w.m_window = nullptr;
34 }
35
36 return *this;
37 }
38
40 {
41 this->m_window = w.m_window;
42 }
43
45 {
46 if (this != &w)
47 {
48 this->m_window = w.m_window;
49 }
50
51 return *this;
52 }
53
55 {
56 m_window = nullptr;
57 }
58
60 {
61 auto& window = entt::locator<Window>::value();
62 m_window = window.handle();
63 }
64} // namespace galaxy
Allows you to bind a base class to the window.
void bind_window() noexcept
Bind SDL3 window to this object.
WindowBindable() noexcept
Constructor.
virtual WindowBindable & operator=(WindowBindable &&) noexcept
Move assignment operator.
virtual ~WindowBindable() noexcept
Virtual destructor.
SDL_Window * m_window
Pointer to SDL_Window handle.
Application.hpp galaxy.