#pragma once #include "chronology.h" #include "collection.h" #include "gfx/gl/uiShader.h" #include "ptr.h" #include "uiComponent.h" // IWYU pragma: keep #include #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); virtual void tick(TickDuration elapsed) = 0; void refresh() const; bool handleInput(const SDL_Event & e); void clear(float r, float g, float b, float a) const; void swapBuffers() const; protected: virtual void render() const; struct GLInitHelper { GLInitHelper(); }; const ScreenAbsCoord size; SDL_WindowPtr m_window; SDL_GLContextPtr glContext; GLInitHelper glInithelper; Collection uiComponents; UIShader uiShader; };