Commit b8ab3f3c authored by Kersten Schuster's avatar Kersten Schuster

1. Try to get Core 4.5 Debug Context; 2. If failed, try to get any (debug)...

1. Try to get Core 4.5 Debug Context; 2. If failed, try to get any (debug) context; 3. If GL version < 3.3 try to get any 3.3 context (intel bug workaround).
parent 7c50af4c
......@@ -529,14 +529,20 @@ int GlfwApp::run(int argc, char *argv[])
// Request debug context
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
// Try to get core context 4.5
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
// Create a windowed mode window and its OpenGL context
mWindow = glfwCreateWindow(mWindowWidth, mWindowHeight, mTitle.c_str(), NULL, NULL);
if (!mWindow)
{
std::cerr << "Unable to create a GLFW window with OpenGL Debug Context. Trying to create one without advanced "
"debugging support."
<< std::endl;
std::cerr << "Unable to get OpenGL 4.5 Core Debug Context. Trying again with Compat." << std::endl;
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_FALSE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 1);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
mWindow = glfwCreateWindow(mWindowWidth, mWindowHeight, mTitle.c_str(), NULL, NULL);
if (!mWindow)
......@@ -571,6 +577,7 @@ int GlfwApp::run(int argc, char *argv[])
// request vanilla 3.3 context
glfwDefaultWindowHints();
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_FALSE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
......
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