mirror of
https://github.com/bailwillharr/engine.git
synced 2024-09-21 04:51:18 +00:00
Make window handle private with getter
This commit is contained in:
parent
45a4db4dcf
commit
c2ec967a89
@ -27,6 +27,8 @@ namespace engine {
|
|||||||
Window& operator=(const Window&) = delete;
|
Window& operator=(const Window&) = delete;
|
||||||
~Window();
|
~Window();
|
||||||
|
|
||||||
|
SDL_Window* getHandle() const;
|
||||||
|
|
||||||
// Return the title name
|
// Return the title name
|
||||||
std::string getTitle() const;
|
std::string getTitle() const;
|
||||||
|
|
||||||
@ -129,11 +131,10 @@ namespace engine {
|
|||||||
/* STATIC METHODS */
|
/* STATIC METHODS */
|
||||||
static void errorBox(const std::string& message);
|
static void errorBox(const std::string& message);
|
||||||
|
|
||||||
public:
|
|
||||||
SDL_Window* m_handle;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
SDL_Window* m_handle;
|
||||||
|
|
||||||
bool m_shouldClose = false;
|
bool m_shouldClose = false;
|
||||||
|
|
||||||
std::string m_title;
|
std::string m_title;
|
||||||
|
@ -8,7 +8,7 @@ namespace engine {
|
|||||||
Application::Application(const char* appName, const char* appVersion)
|
Application::Application(const char* appName, const char* appVersion)
|
||||||
{
|
{
|
||||||
m_win = std::make_unique<Window>(appName);
|
m_win = std::make_unique<Window>(appName);
|
||||||
m_gfx = std::make_unique<GFXDevice>(appName, appVersion, m_win->m_handle);
|
m_gfx = std::make_unique<GFXDevice>(appName, appVersion, m_win->getHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application()
|
Application::~Application()
|
||||||
|
@ -179,6 +179,11 @@ namespace engine {
|
|||||||
|
|
||||||
// public methods
|
// public methods
|
||||||
|
|
||||||
|
SDL_Window* Window::getHandle() const
|
||||||
|
{
|
||||||
|
return m_handle;
|
||||||
|
}
|
||||||
|
|
||||||
std::string Window::getTitle() const
|
std::string Window::getTitle() const
|
||||||
{
|
{
|
||||||
return m_title;
|
return m_title;
|
||||||
|
Loading…
Reference in New Issue
Block a user