summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-10 17:56:00 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-10 17:56:00 +0300
commitc5a6f80e62fd9836a75058ac358d39dd5ec956b5 (patch)
treec36aab0291b39571fff3f577620da6149c32fb63
parent18808109d12835d18d9d1ada96ed394a082a7740 (diff)
downloadmanaplus-c5a6f80e62fd9836a75058ac358d39dd5ec956b5.tar.gz
manaplus-c5a6f80e62fd9836a75058ac358d39dd5ec956b5.tar.bz2
manaplus-c5a6f80e62fd9836a75058ac358d39dd5ec956b5.tar.xz
manaplus-c5a6f80e62fd9836a75058ac358d39dd5ec956b5.zip
Add pointer to OpenGL function glActiveTexture.
-rw-r--r--src/graphicsmanager.cpp30
-rw-r--r--src/render/mgl.hpp1
-rw-r--r--src/render/mglemu.cpp4
-rw-r--r--src/render/mglemu.h1
-rw-r--r--src/render/mgltypes.h1
5 files changed, 31 insertions, 6 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index bd7347e53..70c4346bf 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -896,6 +896,7 @@ void GraphicsManager::initOpenGLFunctions()
const bool is10 = checkGLVersion(1, 0);
const bool is11 = checkGLVersion(1, 1);
const bool is12 = checkGLVersion(1, 2);
+ const bool is13 = checkGLVersion(1, 3);
const bool is15 = checkGLVersion(1, 5);
const bool is20 = checkGLVersion(2, 0);
const bool is21 = checkGLVersion(2, 1);
@@ -936,6 +937,7 @@ void GraphicsManager::initOpenGLFunctions()
{
mSupportModernOpengl = false;
emulateFunction(glTextureSubImage2D);
+ emulateFunction(glActiveTexture);
return;
}
@@ -978,12 +980,6 @@ void GraphicsManager::initOpenGLFunctions()
}
}
- if (is20 || supportExtension("GL_ARB_explicit_attrib_location"))
- {
- logger->log1("found GL_ARB_explicit_attrib_location");
- assignFunction(glBindAttribLocation);
- }
-
if (is12 && (is42 || supportExtension("GL_ARB_texture_storage")))
{
logger->log1("found GL_ARB_texture_storage");
@@ -993,6 +989,28 @@ void GraphicsManager::initOpenGLFunctions()
{
logger->log1("GL_ARB_texture_storage not found");
}
+
+ if (is13 || supportExtension("GL_ARB_multitexture"))
+ {
+ logger->log1("found GL_ARB_multitexture or OpenGL 1.3");
+ assignFunction(glActiveTexture);
+ }
+ else
+ {
+ emulateFunction(glActiveTexture);
+ logger->log1("GL_ARB_multitexture not found");
+ }
+
+ if (is20 || supportExtension("GL_ARB_explicit_attrib_location"))
+ {
+ logger->log1("found GL_ARB_explicit_attrib_location or OpenGL 2.0");
+ assignFunction(glBindAttribLocation);
+ }
+ else
+ {
+ logger->log1("GL_ARB_explicit_attrib_location not found");
+ }
+
if (is30 || supportExtension("GL_ARB_framebuffer_object"))
{ // frame buffer supported
logger->log1("found GL_ARB_framebuffer_object");
diff --git a/src/render/mgl.hpp b/src/render/mgl.hpp
index 47ad276d3..118b9491c 100644
--- a/src/render/mgl.hpp
+++ b/src/render/mgl.hpp
@@ -103,6 +103,7 @@ defName(glTextureSubImage2D);
defName(glClearTexImage);
defName(glClearTexSubImage);
defName(glBindAttribLocation);
+defName(glActiveTexture);
#ifdef WIN32
defName(wglGetExtensionsString);
#endif
diff --git a/src/render/mglemu.cpp b/src/render/mglemu.cpp
index 30330d9a5..4b46b341b 100644
--- a/src/render/mglemu.cpp
+++ b/src/render/mglemu.cpp
@@ -40,4 +40,8 @@ void APIENTRY emuglTextureSubImage2D(GLuint texture, GLenum target,
format, type, pixels);
}
+void APIENTRY emuglActiveTexture (GLenum texture A_UNUSED)
+{
+}
+
#endif
diff --git a/src/render/mglemu.h b/src/render/mglemu.h
index f22877939..536a02011 100644
--- a/src/render/mglemu.h
+++ b/src/render/mglemu.h
@@ -31,6 +31,7 @@ void APIENTRY emuglTextureSubImage2D(GLuint texture, GLenum target,
GLenum format, GLenum type,
const void *pixels);
+void APIENTRY emuglActiveTexture (GLenum texture);
#endif // USE_OPENGL
#endif // RENDER_MGLEMU_H
diff --git a/src/render/mgltypes.h b/src/render/mgltypes.h
index 6b55f4430..479f5e177 100644
--- a/src/render/mgltypes.h
+++ b/src/render/mgltypes.h
@@ -187,6 +187,7 @@ typedef void (APIENTRY *glClearTexSubImage_t) (GLuint texture, GLint level,
GLsizei depth, GLenum format, GLenum type, const void * data);
typedef void (APIENTRY *glBindAttribLocation_t) (GLuint program,
GLuint index, const GLchar *name);
+typedef void (APIENTRY *glActiveTexture_t) (GLenum texture);
// callback
typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id,