It seams like window_width and window_height values must be integers on line 179 and 180, which may not always happen because of the math you're doing i think.
I got the error
File ".../lib/python3.7/site-packages/pyglet/window/xlib/init.py", line 246, in _createbyref(window_attributes))
ctypes.ArgumentError: argument 5: <class 'TypeError'>:wrong type
I fixed this by casting the window_width and window_height to integers.
It seams like window_width and window_height values must be integers on line 179 and 180, which may not always happen because of the math you're doing i think. I got the error File ".../lib/python3.7/site-packages/pyglet/window/xlib/init.py", line 246, in _createbyref(window_attributes)) ctypes.ArgumentError: argument 5: <class 'TypeError'>:wrong type I fixed this by casting the window_width and window_height to integers.