Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL.error.GLError: GLError - err = 1281 - description = b'invalid value' #32

Closed
sla-te opened this issue Oct 24, 2020 · 5 comments
Closed

Comments

@sla-te
Copy link
Contributor

sla-te commented Oct 24, 2020

I just got this one, It happened randomly without any special interaction:

  File "C:\Users\user\PycharmProjects\my_app\app.py", line 646, in <module>
    
  File "C:\Users\user\PycharmProjects\my_app\app.py", line 101, in __init__
    c.main(widget=c.font(self.__initialize_custom_font(), self.run_application(u=self.u, o=self.o)), name=f"My Appv{self.version}", width=1024, height=768, menu_bar=True, fps=60)
  File "C:\Users\user\PycharmProjects\my_app\venv\lib\site-packages\concur\integrations\glfw.py", line 172, in main
    impl.render(imgui.get_draw_data())
  File "C:\Users\user\PycharmProjects\my_app\venv\lib\site-packages\imgui\integrations\opengl.py", line 236, in render
    gl.glScissor(int(x), int(fb_height - w), int(z - x), int(w - y))
  File "C:\Users\user\PycharmProjects\my_app\venv\lib\site-packages\OpenGL\error.py", line 230, in glCheckError
    raise self._errorClass(
OpenGL.error.GLError: GLError(
	err = 1281,
	description = b'invalid value',
	baseOperation = glScissor,
	cArguments = (81, 1, -35, 727)
)

Not sure if that tells you anything and its not something, that happens all the time but I wanted to report it just to be sure.

EDIT: I was able to reproduce it by clicking special buttons on my Mouse Logitech G502 multiple times. Do note, that one of the custom keys will trigger the Windows action to "Show the Desktop", meaning minimize all windows and I believe its related to that, at least it seems like it.
EDIT2: As the error seems to be related to OpenGL I opened an issue over there: mcfletch/pyopengl#53

@sla-te sla-te changed the title Unknown OpenGL error OpenGL.error.GLError: GLError Oct 24, 2020
@sla-te sla-te changed the title OpenGL.error.GLError: GLError OpenGL.error.GLError: GLError - err = 1281 - description = b'invalid value' Oct 24, 2020
@potocpav
Copy link
Owner

potocpav commented Nov 2, 2020

Thanks for the bug report. I don't know how to solve it without a more precise cause, or a way to reproduce the bug. Somebody is clearly setting an invalid scissor box. GLFW, maybe? I can't find such a code though.

@sla-te
Copy link
Contributor Author

sla-te commented Nov 2, 2020

Take a look at the issue over at GLFW. Is there a way to catch this error in any way, to make sure it just does not happen? Im having trouble to consistently reproduce it myself as well.

@potocpav
Copy link
Owner

potocpav commented Nov 3, 2020

It looks simple to work around. Replace this line with the following to force non-negative scissor box width and height.

gl.glScissor(int(x), int(fb_height - w), max(0, int(z - x)), max(0, int(w - y)))

That said, this is either a bug in ImGui, or ImGui mis-use. Do you do anything suspicious with columns, or child boxes, etc.? Related bug: ocornut/imgui#3475

@sla-te
Copy link
Contributor Author

sla-te commented Nov 4, 2020

I have a lot of selectables and pictures inside columns if you would consider this suspicious :D. Why not make this change default, could it possibly cause any problems?

@potocpav
Copy link
Owner

potocpav commented Nov 4, 2020

Probably not. The only problem is that it's yet another deviation from upstream. Will do, stability is important.

@sla-te sla-te closed this as completed Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants