summaryrefslogtreecommitdiff
path: root/ui/window.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-05-28 11:45:01 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-05-28 11:45:01 +0100
commit3c1c392ab177566f09d11a380210e1937741fad2 (patch)
tree67b12689c60dc2e75a5587988dd11bf36c12da9a /ui/window.cpp
parentAdd glad submodule and build a glad library (diff)
downloadilt-3c1c392ab177566f09d11a380210e1937741fad2.tar.bz2
ilt-3c1c392ab177566f09d11a380210e1937741fad2.tar.xz
ilt-3c1c392ab177566f09d11a380210e1937741fad2.zip
Swap GLEW for more modern glad
Diffstat (limited to 'ui/window.cpp')
-rw-r--r--ui/window.cpp10
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;
}
}();
}