summaryrefslogtreecommitdiff
path: root/ui/window.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-12 11:38:34 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-14 23:46:14 +0000
commit82bfbf1f459d540b0e204bb873ca5786997b24da (patch)
tree3b409db10a77d10f52a3ce45f135a423d8ff2da1 /ui/window.h
parentFix type of SceneShader (diff)
downloadilt-82bfbf1f459d540b0e204bb873ca5786997b24da.tar.bz2
ilt-82bfbf1f459d540b0e204bb873ca5786997b24da.tar.xz
ilt-82bfbf1f459d540b0e204bb873ca5786997b24da.zip
Refactor for per window context and more setup to the right places
Diffstat (limited to 'ui/window.h')
-rw-r--r--ui/window.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/window.h b/ui/window.h
index 0661915..d618976 100644
--- a/ui/window.h
+++ b/ui/window.h
@@ -26,12 +26,18 @@ public:
void swapBuffers() const;
protected:
- [[nodiscard]] SDL_GLContext glContext() const;
virtual void render() const;
+ struct GlewInitHelper {
+ GlewInitHelper();
+ };
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>;
const glm::ivec2 size;
SDL_WindowPtr m_window;
+ SDL_GLContextPtr glContext;
+ GlewInitHelper glewinithelper;
Collection<UIComponent> uiComponents;
UIShader uiShader;
};