diff options
author | numzero <numzer0@yandex.ru> | 2023-02-27 20:32:06 +0300 |
---|---|---|
committer | numzero <numzer0@yandex.ru> | 2023-02-27 20:32:06 +0300 |
commit | 608aa150ffe23d0317854ac3a94f39a856fcdaca (patch) | |
tree | 88dea0428c328b30b2db0bb115abc48dd2457635 /source/Irrlicht/OpenGL/ExtensionHandler.cpp | |
parent | 1f750cd7b26348aa799b2ebc9a779f670dba5f4f (diff) | |
download | irrlicht-608aa150ffe23d0317854ac3a94f39a856fcdaca.tar.xz |
Load extensions the OpenGL 3 way
Diffstat (limited to 'source/Irrlicht/OpenGL/ExtensionHandler.cpp')
-rw-r--r-- | source/Irrlicht/OpenGL/ExtensionHandler.cpp | 18 |
1 files 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 <mt_opengl.h>
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<IRR_OGLES_Feature_Count; ++j) {
+ if (!strcmp(getFeatureString(j), ext_name)) {
+ FeatureAvailable[j] = true;
+ break;
+ }
+ }
+ }
GLint val=0;
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &val);
|