From 8827f34cea289bea15930389fac14e636a824cb2 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Wed, 30 Dec 2020 13:06:44 +0100 Subject: [PATCH] Add OGL version check --- inferno/src/inferno/render/context.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/inferno/src/inferno/render/context.cpp b/inferno/src/inferno/render/context.cpp index 412e659..620df49 100644 --- a/inferno/src/inferno/render/context.cpp +++ b/inferno/src/inferno/render/context.cpp @@ -29,6 +29,15 @@ namespace Inferno { dbg(Log::Info) << " Renderer: " << glGetString(GL_RENDERER); dbg(Log::Info) << " Version: " << glGetString(GL_VERSION); +#ifdef NF_ENABLE_ASSERTS + int versionMajor; + int versionMinor; + glGetIntegerv(GL_MAJOR_VERSION, &versionMajor); + glGetIntegerv(GL_MINOR_VERSION, &versionMinor); + ASSERT(versionMajor > 4 || (versionMajor == 4 && versionMinor >= 5), + "Inferno requires at least OpenGL version 4.5!"); +#endif + Window &w = *(Window*)glfwGetWindowUserPointer(m_window); // Disable vsync