diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-05-28 11:45:22 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-05-28 11:45:22 +0100 |
commit | fdea7529ba09a615d92da5823429b49c7e565c9d (patch) | |
tree | 67b12689c60dc2e75a5587988dd11bf36c12da9a /ui/window.cpp | |
parent | Mark main rule as always, so we can always launch it (diff) | |
parent | Swap GLEW for more modern glad (diff) | |
download | ilt-fdea7529ba09a615d92da5823429b49c7e565c9d.tar.bz2 ilt-fdea7529ba09a615d92da5823429b49c7e565c9d.tar.xz ilt-fdea7529ba09a615d92da5823429b49c7e565c9d.zip |
Merge branch 'glad'
Diffstat (limited to 'ui/window.cpp')
-rw-r--r-- | ui/window.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/window.cpp b/ui/window.cpp index 731996a..93e85bd 100644 --- a/ui/window.cpp +++ b/ui/window.cpp @@ -1,20 +1,20 @@ #include "window.h" #include "uiComponent.h" #include "worldOverlay.h" -#include <GL/glew.h> +#include <glad/gl.h> #include <glm/glm.hpp> #include <stdexcept> #include <tuple> #include <type_traits> -Window::GlewInitHelper::GlewInitHelper() +Window::GLInitHelper::GLInitHelper() { [[maybe_unused]] static auto init = []() { - if (const auto r = glewInit(); r != GLEW_OK) { - throw std::runtime_error {reinterpret_cast<const char *>(glewGetErrorString(r))}; + if (const auto version = gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress)); version != 40006) { + throw std::runtime_error {std::to_string(version)}; } else { - return r; + return version; } }(); } |