Commit 5e5dbb5a authored by Philip Trettner's avatar Philip Trettner

Added workaround for drivers that don't support debug contices

parent 12f6adb7
......@@ -490,17 +490,26 @@ int GlfwApp::run(int argc, char *argv[])
mWindow = glfwCreateWindow(mWindowWidth, mWindowHeight, mTitle.c_str(), NULL, NULL);
if (!mWindow)
{
std::cerr << "Unable to create a GLFW window" << std::endl;
glfwTerminate();
return -1;
std::cerr << "Unable to create a GLFW window with OpenGL Debug Context. Trying to create one without advanced "
"debugging support."
<< std::endl;
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_FALSE);
mWindow = glfwCreateWindow(mWindowWidth, mWindowHeight, mTitle.c_str(), NULL, NULL);
if (!mWindow)
{
std::cerr << "Unable to create a GLFW window" << std::endl;
glfwTerminate();
return -1;
}
}
// Make the window's context current
glfwMakeContextCurrent(mWindow);
// WORKAROUND for Intel bug (3.3 available but 3.0 returned UNLESS explicitly requested)
using glGetIntegerFunc = void(GLenum, GLint*);
auto getGlInt = (glGetIntegerFunc*)glfwGetProcAddress("glGetIntegerv");
using glGetIntegerFunc = void(GLenum, GLint *);
auto getGlInt = (glGetIntegerFunc *)glfwGetProcAddress("glGetIntegerv");
GLint gmajor, gminor;
getGlInt(GL_MAJOR_VERSION, &gmajor);
getGlInt(GL_MINOR_VERSION, &gminor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment