You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the current version of pyglet (2.0.15), running this script from pycharm exits immediately with error code -1073740791. This kind of non-verbose crashing is typical of pyqt6 and switching to pyside usually gives more verbose output. So after switching out pyqt6 to pyside6 we get a little more progress - a window appears however we get an error appearing in the console:
Exception ignored on calling ctypes callback function: <function Win32Window._get_window_proc.<locals>.f at 0x0000020B7E14DC60>
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\qtextras-EeoUgCsC-py3.10\lib\site-packages\pyglet\window\win32\__init__.py", line 741, in f
event_handler = event_handlers.get(msg, None)
SystemError: <method 'get' of 'dict' objects> returned a result with an exception set
what's more pressing 'create rectangle' spews this message into the console:
Traceback (most recent call last):
File "C:\Users\user\Documents\git\qtextras\examples\pyglet_example.py", line 89, in paintGL
self.batch.draw()
File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\qtextras-EeoUgCsC-py3.10\lib\site-packages\pyglet\graphics\__init__.py", line 409, in draw
func()
File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\qtextras-EeoUgCsC-py3.10\lib\site-packages\pyglet\graphics\__init__.py", line 338, in <lambda>
draw_list.append((lambda d, m: lambda: d.draw(m))(domain, mode))
File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\qtextras-EeoUgCsC-py3.10\lib\site-packages\pyglet\graphics\vertexdomain.py", line 177, in draw
self.vao.bind()
File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\qtextras-EeoUgCsC-py3.10\lib\site-packages\pyglet\graphics\vertexarray.py", line 23, in bind
glBindVertexArray(self._id)
File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\qtextras-EeoUgCsC-py3.10\lib\site-packages\pyglet\gl\lib.py", line 78, in errcheck
raise GLException(f'(0x{error}): {msg}')
pyglet.gl.lib.GLException: (0x1282): Invalid operation. The specified operation is not allowed in the current state.
Downgrading pyglet to v1.5.17 (the version available at the time the sample code was produced) appears to fix the issue - the app starts normally without the dict error and pushing the 'add rectangle' button adds a rectangle to the scene and can be viewed.
If this is no longer the recommended way of integrating with pyqt - or if this just isn't possible, please let me know. However would be great to have this working with the latest version of pyglet!
The text was updated successfully, but these errors were encountered:
Please note that mixing pyglet with other UI libraries is not supported. It can work, but we just can't provide support for it. Things can and do break as new versions come out, so your mileage will vary.
I would also suggest that if your UI needs are more basic, see if the pyglet.gui module will do the job. It's limited in scope to what you might need for a game, or simple visualization application, but can be used as an example to build custom widgets on.
Keen to integrate a pyqt-based gui with my project, I followed the sample code in the top answer here:
https://stackoverflow.com/questions/72714242/render-pyglet-window-inside-pyqt6-window
With the current version of pyglet (2.0.15), running this script from pycharm exits immediately with error code -1073740791. This kind of non-verbose crashing is typical of pyqt6 and switching to pyside usually gives more verbose output. So after switching out pyqt6 to pyside6 we get a little more progress - a window appears however we get an error appearing in the console:
what's more pressing 'create rectangle' spews this message into the console:
Downgrading pyglet to v1.5.17 (the version available at the time the sample code was produced) appears to fix the issue - the app starts normally without the dict error and pushing the 'add rectangle' button adds a rectangle to the scene and can be viewed.
pyglet.info for working:
info for not working:
If this is no longer the recommended way of integrating with pyqt - or if this just isn't possible, please let me know. However would be great to have this working with the latest version of pyglet!
The text was updated successfully, but these errors were encountered: