diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-25 18:35:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-25 18:35:05 +0300 |
commit | 201fd8962f269dbe1aeacd7185720ec86e2ac5b7 (patch) | |
tree | 1d728ec33a064287335ef276a26cc26eabe8ea75 /src/graphicsmanager.cpp | |
parent | 84d56b88a03054d35b84dc1ecbd7ad4614f8ac86 (diff) | |
download | manaverse-201fd8962f269dbe1aeacd7185720ec86e2ac5b7.tar.gz manaverse-201fd8962f269dbe1aeacd7185720ec86e2ac5b7.tar.bz2 manaverse-201fd8962f269dbe1aeacd7185720ec86e2ac5b7.tar.xz manaverse-201fd8962f269dbe1aeacd7185720ec86e2ac5b7.zip |
Add shaders version logging and checking.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r-- | src/graphicsmanager.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 7a7a25709..f60bf1aa4 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -107,8 +107,11 @@ GraphicsManager::GraphicsManager() : mGlVersionString(), mGlVendor(), mGlRenderer(), + mGlShaderVersionString(), mMinor(0), mMajor(0), + mSLMinor(0), + mSLMajor(0), mPlatformMinor(0), mPlatformMajor(0), mMaxVertices(500), @@ -729,6 +732,8 @@ void GraphicsManager::setGLVersion() sscanf(mGlVersionString.c_str(), "%5d.%5d", &mMajor, &mMinor); mGlVendor = getGLString(GL_VENDOR); mGlRenderer = getGLString(GL_RENDERER); + mGlShaderVersionString = getGLString(GL_SHADING_LANGUAGE_VERSION); + sscanf(mGlShaderVersionString.c_str(), "%5d.%5d", &mSLMajor, &mSLMinor); } void GraphicsManager::logVersion() const @@ -736,6 +741,7 @@ void GraphicsManager::logVersion() const logger->log("gl vendor: " + mGlVendor); logger->log("gl renderer: " + mGlRenderer); logger->log("gl version: " + mGlVersionString); + logger->log("glsl version: " + mGlShaderVersionString); } bool GraphicsManager::checkGLVersion(const int major, const int minor) const @@ -743,6 +749,11 @@ bool GraphicsManager::checkGLVersion(const int major, const int minor) const return mMajor > major || (mMajor == major && mMinor >= minor); } +bool GraphicsManager::checkSLVersion(const int major, const int minor) const +{ + return mSLMajor > major || (mSLMajor == major && mSLMinor >= minor); +} + bool GraphicsManager::checkPlatformVersion(const int major, const int minor) const { |