diff --git a/src/Window.cpp b/src/Window.cpp index 186812f..6d71fbc 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -17,8 +17,8 @@ using namespace sc::gui; std::vector Window::_windows; std::map> Window::_global_event_handlers; -Window& Window::new_window(const std::string& title) { - _windows.emplace_back(title); +Window& Window::new_window(const std::string& title, Uint32 flags) { + _windows.emplace_back(title, flags); return _windows.back(); } @@ -93,11 +93,11 @@ bool Window::close(const SDL_Event& event) { return _windows.size() == 0; } -Window::Window(const std::string& title) : _title {title} { +Window::Window(const std::string& title, Uint32 flags) : _title {title} { SDL_Window* win = SDL_CreateWindow(title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1600, 900, - SDL_WINDOW_RESIZABLE); + flags); _w.reset(win); _r.reset(SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED)); } diff --git a/src/Window.hpp b/src/Window.hpp index 2ac8b59..8393eb5 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -29,9 +29,9 @@ namespace sc { static bool handle_global_event(const SDL_Event& event); static void add_global_event_handler(WindowEventHandler handler, SDL_WindowEventID type); static Window* from_sdl(Uint32 window_id); - static Window& new_window(const std::string& title); + static Window& new_window(const std::string& title, Uint32 flags = SDL_WINDOW_RESIZABLE); - Window(const std::string& title); + Window(const std::string& title, Uint32 flags); void add_event_handler(WindowEventHandler handler, SDL_WindowEventID type); bool handle_event(const SDL_Event& event, bool quit);