1

I can't open an OpenGL window, due to following error message (I'm on Windows):

GLFW Error Code 65543: WGL: OpenGL profile requested but WGL_ARB_create_context_profile is unavailable.

It is likely that my problem is a driver problem. I tried to update them (using Intel Driver Update Utility), but it didn't do the trick (and my driver seemed to be already up to date). I use built-in Intel HD Graphics 3000. I also installed a OpenGL viewer, which tells me that my OpenGL version is 3.1).

Also, I tried this solution.

The whole C++ code is quite huge so I won't copy it all , but here is the interesting part:

if( !glfwInit() )
{
  std::cerr<<"Failed to initialize GLFW\n"<<std::endl;
  return -1;
}
glfwSetErrorCallback(glfwErrorCallback);

// Create the OpenGL window
glfwWindowHint(GLFW_DEPTH_BITS, 16);
glfwWindowHint(GLFW_SAMPLES, 4);

//Those stop GLFW from initializing successfully?
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

// Open OpenGL fullscreen window
gGLFWWindow = glfwCreateWindow(gWidth,gHeight,"GLFW OpenGL Window",nullptr,nullptr);

if(!gGLFWWindow)
{
  std::cerr<<"Failed to open GLFW window\n"<<std::endl;
  glfwTerminate();
  return -1;
}

// Disable VSync (we want to get as high FPS as possible!)
glfwMakeContextCurrent(gGLFWWindow);
glfwSwapInterval( 1 );

// Setting this is necessary for core profile (tested with MSVC 2013 x64, Windows 7)
glewExperimental = GL_TRUE;
// GLEW wraps all OpenGL functions and extensions
GLenum err = glewInit();
if(err != GLEW_OK)
{
  std::cerr<<"Failed to initialize GLEW"<<std::endl;
  std::cerr<<(char*)glewGetErrorString(err)<<std::endl;
  glfwTerminate();
  return -1;
}
glGetError(); //GLEW might cause an 'invalid enum' error, safely ignore it?

// Print OpenGL context information to console
ogl::printContextInformation();

// Perform our initialization (OpenGL states, shader, camera, geometry)
if(!init())
  return -1;

It fails at this line :

gGLFWWindow = glfwCreateWindow(gWidth,gHeight,"GLFW OpenGL Window",nullptr,nullptr);

Does anyone have an idea of what I could do to solve this issue?

Community
  • 1
  • 1
Reyedy
  • 918
  • 2
  • 13
  • 36
  • 2
    If you only have OpenGL 3.1 why are you requesting a Core 3.3 context? – genpfault Sep 26 '16 at 13:58
  • Because I don't understand all this code (it was given to me and I have to work from it), but you're actually right. I commented those lines and it did the trick, thank you ! – Reyedy Sep 26 '16 at 14:00

2 Answers2

2

The answer is : I was requesting a Core 3.3 context whereas my version was OpenGL 3.1. Deleting/commenting those lines will do the trick :

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
Reyedy
  • 918
  • 2
  • 13
  • 36
-2

I to had the same problem because my last machine has an openGl of version 3.3 and now because the one am using now has but an openGl 3.1 made me almost got frustrated But De-comenting the "window hints"enter image description here, it solves the problem

pppery
  • 3,731
  • 22
  • 33
  • 46
MegaPercy
  • 1
  • 1