summaryrefslogtreecommitdiff
path: root/ui/window.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-03 21:31:35 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-03 21:31:35 +0000
commit19e60cf08ba8800b7214c0865ebb2fc6b880c7bd (patch)
tree3f076ffc90415975f0abb3cb1a5a234ca75cad8f /ui/window.cpp
parentMerge branch 'glad' (diff)
downloadilt-19e60cf08ba8800b7214c0865ebb2fc6b880c7bd.tar.bz2
ilt-19e60cf08ba8800b7214c0865ebb2fc6b880c7bd.tar.xz
ilt-19e60cf08ba8800b7214c0865ebb2fc6b880c7bd.zip
Don't request a specific OpenGL version, just check we get something sufficient from gladLoadGL
Diffstat (limited to 'ui/window.cpp')
-rw-r--r--ui/window.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/ui/window.cpp b/ui/window.cpp
index 93e85bd..6855aa0 100644
--- a/ui/window.cpp
+++ b/ui/window.cpp
@@ -1,17 +1,15 @@
#include "window.h"
#include "uiComponent.h"
-#include "worldOverlay.h"
#include <glad/gl.h>
#include <glm/glm.hpp>
#include <stdexcept>
-#include <tuple>
-#include <type_traits>
Window::GLInitHelper::GLInitHelper()
{
[[maybe_unused]] static auto init = []() {
- if (const auto version = gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress)); version != 40006) {
- throw std::runtime_error {std::to_string(version)};
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
+ if (const auto version = gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress)); version < 30003) {
+ throw std::runtime_error {"Insufficient OpenGL version: " + std::to_string(version)};
}
else {
return version;