OPENGL: add checks for case when glGetString return NULL

This commit is contained in:
Pawel Kolodziejski 2016-03-10 05:54:24 +01:00
parent 68ee863367
commit 4e47c03a64
2 changed files with 5 additions and 1 deletions

View file

@ -131,6 +131,10 @@ void Context::initialize(ContextType contextType) {
int Context::getGLSLVersion() const {
const char *glslVersionString = (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION);
if (!glslVersionString) {
warning("Could not get GLSL version");
return 0;
}
const char *glslVersionFormat;
if (type == kContextGL) {