#pragma once #include "chronology.h" #include "config/types.h" #include "ptr.h" #include "special_members.h" #include "windowContent.h" #include #include #include using SDL_WindowPtr = wrapped_ptrt; using GL_Context = std::remove_pointer_t; using SDL_GLContextPtr = wrapped_ptrt; class Window { public: Window(size_t width, size_t height, const std::string & title, Uint32 flags); virtual ~Window() = default; NO_COPY(Window); NO_MOVE(Window); template void setContent(P &&... p) { glm::ivec2 size {}; SDL_GetWindowSizeInPixels(m_window, &size.x, &size.y); content = std::make_unique(size.x, size.y, std::forward

(p)...); } void tick(TickDuration elapsed); void refresh() const; bool handleInput(const SDL_Event & e); void swapBuffers() const; protected: void clear(float r, float g, float b, float a) const; const ScreenAbsCoord size; SDL_WindowPtr m_window; SDL_GLContextPtr glContext; WindowContent::Ptr content; };