Added check against glGetString(GL_VERSION) returning NULL.

This commit is contained in:
Robert Osfield
2005-10-25 13:24:39 +00:00
parent b02df25771
commit 2b2ca82b5a

View File

@@ -270,7 +270,14 @@ void GL2Extensions::lowestCommonDenominator(const GL2Extensions& rhs)
void GL2Extensions::setupGL2Extensions(unsigned int contextID)
{
_glVersion = atof( (const char*)glGetString( GL_VERSION ) );
const char* version = (const char*) glGetString( GL_VERSION );
if (!version)
{
osg::notify(osg::FATAL)<<"Error: OpenGL version test failed, requires valid graphics context."<<std::endl;
return;
}
_glVersion = atof( version );
_glslLanguageVersion = 0.0f;
_isShaderObjectsSupported = osg::isGLExtensionSupported(contextID,"GL_ARB_shader_objects");