Create an OpenGL program with a debug context. While it is not strictly necessary to acquire a debug context, we might not get messages that are as informative as when we are using a debug context. To create an OpenGL context using GLFW with debugging enabled, use the following function call prior to creating the window:
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
An OpenGL debug context will have debug messages enabled by default. If, however, you need to enable debug messages explicitly, use the following call:
glEnable(GL_DEBUG_OUTPUT);