diff --git a/include/window.hpp b/include/window.hpp index 39640c9..7686f1c 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -27,6 +27,8 @@ namespace engine { Window& operator=(const Window&) = delete; ~Window(); + SDL_Window* getHandle() const; + // Return the title name std::string getTitle() const; @@ -129,11 +131,10 @@ namespace engine { /* STATIC METHODS */ static void errorBox(const std::string& message); - public: - SDL_Window* m_handle; - private: + SDL_Window* m_handle; + bool m_shouldClose = false; std::string m_title; diff --git a/src/engine.cpp b/src/engine.cpp index e2bc81b..fade760 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -8,7 +8,7 @@ namespace engine { Application::Application(const char* appName, const char* appVersion) { m_win = std::make_unique(appName); - m_gfx = std::make_unique(appName, appVersion, m_win->m_handle); + m_gfx = std::make_unique(appName, appVersion, m_win->getHandle()); } Application::~Application() diff --git a/src/window.cpp b/src/window.cpp index c16d73c..552240b 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -179,6 +179,11 @@ namespace engine { // public methods + SDL_Window* Window::getHandle() const + { + return m_handle; + } + std::string Window::getTitle() const { return m_title;