summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test-glContextBhvr.cpp2
-rw-r--r--ui/applicationBase.cpp3
-rw-r--r--ui/window.cpp8
3 files changed, 4 insertions, 9 deletions
diff --git a/test/test-glContextBhvr.cpp b/test/test-glContextBhvr.cpp
index 1f1215c..769f61f 100644
--- a/test/test-glContextBhvr.cpp
+++ b/test/test-glContextBhvr.cpp
@@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(windowContextThingsBehaviour1)
const SDL_GLContextPtr context {window};
BOOST_REQUIRE(context);
BOOST_REQUIRE(!glCreateProgram);
- BOOST_REQUIRE_EQUAL(gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress)), 40006);
+ BOOST_REQUIRE_GT(gladLoadGL(reinterpret_cast<GLADloadfunc>(SDL_GL_GetProcAddress)), 0);
BOOST_REQUIRE(glCreateProgram);
CreateProgramTest();
} // Context destroyed
diff --git a/ui/applicationBase.cpp b/ui/applicationBase.cpp
index 32af3af..2be1f6c 100644
--- a/ui/applicationBase.cpp
+++ b/ui/applicationBase.cpp
@@ -21,9 +21,6 @@ ApplicationBase::ApplicationBase()
setGlAttribute(SDL_GL_DEPTH_SIZE, 16);
setGlAttribute(SDL_GL_DOUBLEBUFFER, 1);
- setGlAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
- setGlAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
- setGlAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
setGlAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1);
}
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;