singleton for window

This commit is contained in:
arthur.jamet
2021-05-21 12:38:10 +02:00
parent 5d2493ad63
commit e4bd77197a
11 changed files with 47 additions and 24 deletions

View File

@@ -8,7 +8,14 @@
#include "Window.hpp"
#include "Controllers/Mouse.hpp"
RAY::Window::Window(int width, int height, const std::string title, bool openNow):
RAY::Window &RAY::Window::getInstance(int width, int height, const std::string &title, bool openNow)
{
static RAY::Window window(width, height, title, openNow);
return window;
}
RAY::Window::Window(int width, int height, const std::string &title, bool openNow):
_dimensions({(float)width, (float)height}), _title(title), _isOpen(openNow)
{
if (openNow)