diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-29 18:50:02 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-29 18:50:02 +0100 |
commit | 4fb3a5ae0f53a6fa3f4901f92e64f1de8d2dbb17 (patch) | |
tree | 6f4bd0c999e3b4a11410aed234622e80842261ad /ui/window.h | |
parent | Lookup material details once in the vertex shader (diff) | |
download | ilt-4fb3a5ae0f53a6fa3f4901f92e64f1de8d2dbb17.tar.bz2 ilt-4fb3a5ae0f53a6fa3f4901f92e64f1de8d2dbb17.tar.xz ilt-4fb3a5ae0f53a6fa3f4901f92e64f1de8d2dbb17.zip |
Dunno how, but some DOS new lines got in here!
Diffstat (limited to 'ui/window.h')
-rw-r--r-- | ui/window.h | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/ui/window.h b/ui/window.h index cb0118a..8b7d870 100644 --- a/ui/window.h +++ b/ui/window.h @@ -1,44 +1,44 @@ -#pragma once
-
-#include "chronology.hpp"
-#include "collection.hpp"
-#include "gfx/gl/uiShader.h"
-#include "ptr.hpp"
-#include "uiComponent.h" // IWYU pragma: keep
-#include <SDL2/SDL.h>
-#include <cstddef>
-#include <special_members.hpp>
-#include <string>
-
-using SDL_WindowPtr = wrapped_ptrt<SDL_Window, SDL_CreateWindow, SDL_DestroyWindow>;
-using GL_Context = std::remove_pointer_t<SDL_GLContext>;
-using SDL_GLContextPtr = wrapped_ptrt<GL_Context, SDL_GL_CreateContext, SDL_GL_DeleteContext>;
-
-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 GlewInitHelper {
- GlewInitHelper();
- };
-
- const glm::ivec2 size;
- SDL_WindowPtr m_window;
- SDL_GLContextPtr glContext;
- GlewInitHelper glewinithelper;
- Collection<UIComponent> uiComponents;
- UIShader uiShader;
-};
+#pragma once + +#include "chronology.hpp" +#include "collection.hpp" +#include "gfx/gl/uiShader.h" +#include "ptr.hpp" +#include "uiComponent.h" // IWYU pragma: keep +#include <SDL2/SDL.h> +#include <cstddef> +#include <special_members.hpp> +#include <string> + +using SDL_WindowPtr = wrapped_ptrt<SDL_Window, SDL_CreateWindow, SDL_DestroyWindow>; +using GL_Context = std::remove_pointer_t<SDL_GLContext>; +using SDL_GLContextPtr = wrapped_ptrt<GL_Context, SDL_GL_CreateContext, SDL_GL_DeleteContext>; + +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 GlewInitHelper { + GlewInitHelper(); + }; + + const glm::ivec2 size; + SDL_WindowPtr m_window; + SDL_GLContextPtr glContext; + GlewInitHelper glewinithelper; + Collection<UIComponent> uiComponents; + UIShader uiShader; +}; |