skaslev / gl3w

Simple OpenGL core profile loading
http://github.com/skaslev/gl3w
The Unlicense
705 stars 157 forks source link

OpenGL 4.6 but get GL3W_ERROR_OPENGL_VERSION #72

Closed OrKaraz closed 3 years ago

OrKaraz commented 3 years ago

Hi,

In my project, when i init OpenGL with gl3wInit i have an error : GL3W_ERROR_OPENGL_VERSION

The code below (get from here) return strange value. I have put it in the parse_version function.

int major, minor; glGetIntegerv(GL_MAJOR_VERSION, &major); glGetIntegerv(GL_MINOR_VERSION, &minor); printf("%d.%d\n", major, minor);

printf return : 0.1275

any solution ? Thanks for help

OpenGL

skaslev commented 3 years ago

Can you post a more complete code sample for how you create OpenGL context?

You probably have to request core profile context. In glut goes something along the lines of

    glutInit(&argc, argv);
    glutInitContextVersion(4, 6);
    glutInitContextProfile(GLUT_CORE_PROFILE);

or

    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);

for glfw.

OrKaraz commented 3 years ago

Hi,

My bad, wrong copy/paste from example.

Thanks