From 608aa150ffe23d0317854ac3a94f39a856fcdaca Mon Sep 17 00:00:00 2001 From: numzero Date: Mon, 27 Feb 2023 20:32:06 +0300 Subject: [PATCH] Load extensions the OpenGL 3 way --- source/Irrlicht/OpenGL/ExtensionHandler.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/source/Irrlicht/OpenGL/ExtensionHandler.cpp b/source/Irrlicht/OpenGL/ExtensionHandler.cpp index 297aa94..055738b 100644 --- a/source/Irrlicht/OpenGL/ExtensionHandler.cpp +++ b/source/Irrlicht/OpenGL/ExtensionHandler.cpp @@ -9,6 +9,7 @@ #include "irrString.h" #include "SMaterial.h" #include "fast_atof.h" +#include namespace irr { @@ -16,9 +17,22 @@ namespace video { void COpenGL3ExtensionHandler::initExtensions() { - getGLVersion(); + GLint major, minor; + glGetIntegerv(GL_MAJOR_VERSION, &major); + glGetIntegerv(GL_MINOR_VERSION, &minor); + Version = 100 * major + 10 * minor; - getGLExtensions(); + GLint ext_count = 0; + GL.GetIntegerv(GL_NUM_EXTENSIONS, &ext_count); + for (int k = 0; k < ext_count; k++) { + auto ext_name = (char *)GL.GetStringi(GL_EXTENSIONS, k); + for (size_t j=0; j