imgui: glGetError on CORE profile glfw

Version/Branch of Dear ImGui:

Version: 1.70WIP Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: the sample: example_glfw_opengl3

Operating System: Windows7

My Issue/Question:

When setting in this example

    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);  // 3.2+ only

and checking glGetError as

        glfwMakeContextCurrent(window);
	int err = glGetError();
	if(err!=GL_NO_ERROR)
           printf("glError %d\n",err);
        glfwSwapBuffers(window);

example is running whitout any visual difference but glGetError is reporting 1280 It does not happen with COMPAT profile.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

According to 😕/www.khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonMode.xhtml GL_POLYGON_MODE can be used for glGet.

So this is not an imgui issue but a Radeon driver issue (which they havent updated since 2016)

I just use glGetError after the imgui functions ended to clear the error flag as a temporary solution.

Do you understand how GL_VERSION_1_0 and similar defines are used in glcorearb.h? There should be the key. I only know that glcorearb.h is dedicated to CORE profiles.

This is checking if another of the standard header has already been included. This is suggesting that any OpenGL version from 1.1 has GL_POLYGON_MODE already, but the loader doesn’t really bother with deprecations unfortunately.

Only could found this https://community.amd.com/thread/169728 And I tried to get last driver other times for another problem without succes 😦

Until now you mentioned user-side code and glfwMakeContextCurrent() giving out an error…

I didnt mean that but that I inserted some code after that in example https://github.com/ocornut/imgui/blob/master/examples/example_glfw_opengl3/main.cpp#L181

Now, this is the first time in this thread that you mention that imgui_impl_opengl3.cpp is affected… we are getting somewhere.

If you search the issue you will get several references to opengl3 implementation

If you are 100% sure that there is no error before the call to glGetIntegerv(GL_POLYGON_MODE… and one after, then this becomes an issue we ought to fix.

I did glGetError in several places: no error before and an error after this line

function glPolygonMode() is supported by pretty much all version of GL, and it is implied that glGet GL_POLYGON_MODE is the same.

In https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml you will not find this constant It gets defined in https://github.com/ocornut/imgui/blob/master/examples/libs/gl3w/GL/glcorearb.h#L161 because #ifndef GL_VERSION_1_1 but I dont know how this GL_VERSION_1_1 should work

I still dont understand if you dont accept GL version modifications in the examples. But could find where the first 1280 error is caused https://github.com/ocornut/imgui/blob/master/examples/imgui_impl_opengl3.cpp#L177