Added error checking in initialization of GLEW

This commit is contained in:
Laurent Gomila 2011-12-31 11:39:06 +01:00
parent bb6ed5dd29
commit 2a546411d5

View File

@ -112,9 +112,16 @@ void EnsureGlewInit()
static bool initialized = false; static bool initialized = false;
if (!initialized) if (!initialized)
{ {
glewInit(); GLenum status = glewInit();
if (status == GLEW_OK)
{
initialized = true; initialized = true;
} }
else
{
Err() << "Failed to initialize GLEW, " << glewGetErrorString(status) << std::endl;
}
}
} }
} // namespace priv } // namespace priv