diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-12-14 02:11:02 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-12-14 02:11:02 +0000 |
commit | 4f22d5daca7d570dbd3caf3da18448350bf5f148 (patch) | |
tree | 5ad8270d71fedae674628d83f9814f62f95c02eb /ui/window.h | |
parent | Refactor to start splitting out UI components (diff) | |
download | ilt-4f22d5daca7d570dbd3caf3da18448350bf5f148.tar.bz2 ilt-4f22d5daca7d570dbd3caf3da18448350bf5f148.tar.xz ilt-4f22d5daca7d570dbd3caf3da18448350bf5f148.zip |
Single glContext shared between windows
Created by the first window, includes simplified refresh/render for single control point
Diffstat (limited to 'ui/window.h')
-rw-r--r-- | ui/window.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ui/window.h b/ui/window.h index f6279e2..8bfc9c3 100644 --- a/ui/window.h +++ b/ui/window.h @@ -20,18 +20,19 @@ public: NO_COPY(Window);
NO_MOVE(Window);
- void Clear(float r, float g, float b, float a) const;
- void SwapBuffers() const;
virtual void tick(TickDuration elapsed) = 0;
- virtual void Refresh(const GameState *) const = 0;
+ void refresh(const GameState *) const;
bool handleInput(const SDL_Event & e);
+ void clear(float r, float g, float b, float a) const;
+ void swapBuffers() const;
+
protected:
- using GL_Context = std::remove_pointer_t<SDL_GLContext>;
+ SDL_GLContext glContext() const;
+ virtual void render(const GameState *) const = 0;
+
using SDL_WindowPtr = wrapped_ptrt<SDL_Window, SDL_CreateWindow, SDL_DestroyWindow>;
- using SDL_GLContextPtr = wrapped_ptrt<GL_Context, SDL_GL_CreateContext, SDL_GL_DeleteContext>;
SDL_WindowPtr m_window;
- SDL_GLContextPtr m_glContext;
Collection<InputHandler> inputStack;
};
|