summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-23 00:41:25 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-23 00:41:25 +0300
commit89106a96cd86042415d19f307a4ade5f1fae8b5d (patch)
tree6308feb8da3c753ae6815eda963b1b994c0d3e95 /src/graphicsmanager.cpp
parentad0c5a085c3c6531db2a84a77d590311ed1d2d8f (diff)
downloadmv-89106a96cd86042415d19f307a4ade5f1fae8b5d.tar.gz
mv-89106a96cd86042415d19f307a4ade5f1fae8b5d.tar.bz2
mv-89106a96cd86042415d19f307a4ade5f1fae8b5d.tar.xz
mv-89106a96cd86042415d19f307a4ade5f1fae8b5d.zip
Add OpenGL debug extensions bindings.
Also show in log information about known extensions.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp45
1 files changed, 34 insertions, 11 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 15768fcb0..d746cb199 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -578,11 +578,31 @@ void GraphicsManager::deleteFBO(FBOInfo *fbo)
void GraphicsManager::initOpenGLFunctions()
{
+ // Texture sampler
+ if (checkGLVersion(1, 0) && supportExtension("GL_ARB_sampler_objects"))
+ {
+ logger->log("found GL_ARB_sampler_objects");
+ assignFunction(glGenSamplers, "glGenSamplers");
+ assignFunction(glDeleteSamplers, "glDeleteSamplers");
+ assignFunction(glBindSampler, "glBindSampler");
+ assignFunction(glSamplerParameteri, "glSamplerParameteri");
+ if (mglGenSamplers && config.getBoolValue("useTextureSampler"))
+ mUseTextureSampler &= true;
+ else
+ mUseTextureSampler = false;
+ }
+ else
+ {
+ logger->log("texture sampler not found");
+ mUseTextureSampler = false;
+ }
+
if (!checkGLVersion(1, 1))
return;
if (supportExtension("GL_ARB_framebuffer_object"))
{ // frame buffer supported
+ logger->log("found GL_ARB_framebuffer_object");
assignFunction(glGenRenderbuffers, "glGenRenderbuffers");
assignFunction(glBindRenderbuffer, "glBindRenderbuffer");
assignFunction(glRenderbufferStorage, "glRenderbufferStorage");
@@ -595,6 +615,7 @@ void GraphicsManager::initOpenGLFunctions()
}
else if (supportExtension("GL_EXT_framebuffer_object"))
{ // old frame buffer extension
+ logger->log("found GL_EXT_framebuffer_object");
assignFunction(glGenRenderbuffers, "glGenRenderbuffersEXT");
assignFunction(glBindRenderbuffer, "glBindRenderbufferEXT");
assignFunction(glRenderbufferStorage, "glRenderbufferStorageEXT");
@@ -608,24 +629,26 @@ void GraphicsManager::initOpenGLFunctions()
}
else
{ // no frame buffer support
+ logger->log("frame buffer not found");
config.setValue("usefbo", false);
}
- // Texture sampler
- if (checkGLVersion(1, 0) && supportExtension("GL_ARB_sampler_objects"))
+ // debug extensions
+ if (supportExtension("GL_KHR_debug"))
{
- assignFunction(glGenSamplers, "glGenSamplers");
- assignFunction(glDeleteSamplers, "glDeleteSamplers");
- assignFunction(glBindSampler, "glBindSampler");
- assignFunction(glSamplerParameteri, "glSamplerParameteri");
- if (mglGenSamplers && config.getBoolValue("useTextureSampler"))
- mUseTextureSampler &= true;
- else
- mUseTextureSampler = false;
+ logger->log("found GL_KHR_debug");
+ assignFunction(glDebugMessageControl, "glDebugMessageControl");
+ assignFunction(glDebugMessageCallback, "glDebugMessageCallback");
+ }
+ else if (supportExtension("GL_ARB_debug_output"))
+ {
+ logger->log("found GL_ARB_debug_output");
+ assignFunction(glDebugMessageControl, "glDebugMessageControlARB");
+ assignFunction(glDebugMessageCallback, "glDebugMessageCallbackARB");
}
else
{
- mUseTextureSampler = false;
+ logger->log("debug extensions not found");
}
#ifdef WIN32