Merge pull request #298 from sephiroth99/fix_glsl_detect

gl4: fix glsl version detection when there is no vendor specific info
This commit is contained in:
Ben Vanik 2015-06-27 11:10:57 -07:00
commit 0d2d07e8e6
1 changed files with 3 additions and 4 deletions

View File

@ -211,11 +211,10 @@ void GLContext::AssertExtensionsPresent() {
} }
// Check shader version at least 4.5 (matching GL 4.5). // Check shader version at least 4.5 (matching GL 4.5).
auto glsl_version_start = auto glsl_version_raw =
reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)); reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION));
auto glsl_version_end = std::strchr(glsl_version_start, ' '); std::string glsl_version(glsl_version_raw);
std::string glsl_version(glsl_version_start, glsl_version_end); if (glsl_version.find("4.50") != 0) {
if (glsl_version.compare("4.50") != 0) {
FatalGLError("OpenGL GLSL version 4.50 is required."); FatalGLError("OpenGL GLSL version 4.50 is required.");
return; return;
} }