aboutsummaryrefslogtreecommitdiff
path: root/source/Irrlicht/OpenGL/ExtensionHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Irrlicht/OpenGL/ExtensionHandler.cpp')
-rw-r--r--source/Irrlicht/OpenGL/ExtensionHandler.cpp18
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);