summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-12 21:35:44 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-12 21:35:44 +0300
commitd9be27bba8941260500066cdd43ebb016356bc67 (patch)
tree884fa01ee78e6ed9a1c5ea526b1b5cd9e37df24b /src/graphicsmanager.cpp
parent18b2da68d0ae157778bab38d6a90f71e5bb95da2 (diff)
downloadmv-d9be27bba8941260500066cdd43ebb016356bc67.tar.gz
mv-d9be27bba8941260500066cdd43ebb016356bc67.tar.bz2
mv-d9be27bba8941260500066cdd43ebb016356bc67.tar.xz
mv-d9be27bba8941260500066cdd43ebb016356bc67.zip
Add macro for checking OpenGL function is it null or not null.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 258c0f9f5..3e9701115 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -43,6 +43,7 @@
#include "settings.h"
#include "render/graphics.h"
+#include "render/mglcheck.h"
#include "render/mgl.h"
#include "render/mglemu.h"
#include "render/mobileopenglgraphics.h"
@@ -135,7 +136,7 @@ GraphicsManager::GraphicsManager() :
GraphicsManager::~GraphicsManager()
{
#ifdef USE_OPENGL
- if (mglGenSamplers && mTextureSampler)
+ if (isGLNotNull(mglGenSamplers) && mTextureSampler)
mglDeleteSamplers(1, &mTextureSampler);
#endif
}
@@ -856,10 +857,15 @@ void GraphicsManager::initOpenGLFunctions()
assignFunction(glDeleteSamplers);
assignFunction(glBindSampler);
assignFunction(glSamplerParameteri);
- if (mglGenSamplers && config.getBoolValue("useTextureSampler"))
+ if (isGLNotNull(mglGenSamplers)
+ && config.getBoolValue("useTextureSampler"))
+ {
mUseTextureSampler &= true;
+ }
else
+ {
mUseTextureSampler = false;
+ }
}
else
{
@@ -965,7 +971,7 @@ void GraphicsManager::initOpenGLFunctions()
{
logger->log1("found GL_EXT_debug_label");
assignFunctionEXT(glLabelObject);
- if (!mglLabelObject)
+ if (isGLNull(mglLabelObject))
assignFunction2(glLabelObject, "glObjectLabel");
assignFunctionEXT(glGetObjectLabel);
}