summaryrefslogtreecommitdiff
path: root/gfx/window.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-12-04 20:11:09 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-12-04 20:11:09 +0000
commit53ae3f24c9458d324572ac8c23f5b8c90c4ac24e (patch)
tree6dfda92116d5f41f6ad9d730785c0694c174e5e2 /gfx/window.h
parentGCC 11 now default (diff)
downloadilt-53ae3f24c9458d324572ac8c23f5b8c90c4ac24e.tar.bz2
ilt-53ae3f24c9458d324572ac8c23f5b8c90c4ac24e.tar.xz
ilt-53ae3f24c9458d324572ac8c23f5b8c90c4ac24e.zip
Refactor wrapped_ptr to include destory function as template param, and possibly constructor function
Diffstat (limited to 'gfx/window.h')
-rw-r--r--gfx/window.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/gfx/window.h b/gfx/window.h
index 3ac583f..252ccaa 100644
--- a/gfx/window.h
+++ b/gfx/window.h
@@ -19,8 +19,11 @@ public:
void SwapBuffers() const;
private:
- wrapped_ptr<SDL_Window> m_window;
- wrapped_ptr<std::remove_pointer_t<SDL_GLContext>> m_glContext;
+ using GL_Context = std::remove_pointer_t<SDL_GLContext>;
+ 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;
};
#endif