diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-12-04 20:11:09 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-12-04 20:11:09 +0000 |
commit | 53ae3f24c9458d324572ac8c23f5b8c90c4ac24e (patch) | |
tree | 6dfda92116d5f41f6ad9d730785c0694c174e5e2 /gfx/window.cpp | |
parent | GCC 11 now default (diff) | |
download | ilt-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.cpp')
-rw-r--r-- | gfx/window.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gfx/window.cpp b/gfx/window.cpp index 2e3c843..dd300a7 100644 --- a/gfx/window.cpp +++ b/gfx/window.cpp @@ -3,10 +3,9 @@ #include <stdexcept>
Window::Window(int width, int height, const std::string & title) :
- m_window {m_window.create(SDL_CreateWindow, SDL_DestroyWindow, title.c_str(),
- static_cast<int>(SDL_WINDOWPOS_CENTERED), static_cast<int>(SDL_WINDOWPOS_CENTERED), width, height,
- static_cast<Uint32>(SDL_WINDOW_OPENGL))},
- m_glContext {m_glContext.create(SDL_GL_CreateContext, SDL_GL_DeleteContext, m_window)}
+ m_window {title.c_str(), static_cast<int>(SDL_WINDOWPOS_CENTERED), static_cast<int>(SDL_WINDOWPOS_CENTERED), width,
+ height, static_cast<Uint32>(SDL_WINDOW_OPENGL)},
+ m_glContext {m_window}
{
if (glewInit() != GLEW_OK) {
throw std::runtime_error {"Glew failed to initialize!"};
|