I am using the latest pyglet and having extreme trouble displaying images. I have stripped my code down to the bare essentials and am baffled by the result:
import pyglet
pyglet.resource.path.append('Assets')
pyglet.resource.reindex()
look = pyglet.resource.image('skybox0.jpg')
print('image size',(look.width, look.height))
window = pyglet.window.Window(800, 600, caption='check my Cube Maps')
@window.event
def on_draw():
window.clear
look.blit(0,0)
return
pyglet.app.run()
Here's what happens:
image size (256, 197) Traceback (most recent call last): File "C:/Python/Python36/Dhruve and me/Pyglet/skybox look.py", line 19, in <module> pyglet.app.run() File "C:\Python\Python36\lib\site-packages\pyglet\app\__init__.py", line 107, in run event_loop.run() File "C:\Python\Python36\lib\site-packages\pyglet\app\base.py", line 167, in run timeout = self.idle() File "C:\Python\Python36\lib\site-packages\pyglet\app\base.py", line 243, in idle window.dispatch_event('on_draw') File "C:\Python\Python36\lib\site-packages\pyglet\window\__init__.py", line 1333, in dispatch_event if EventDispatcher.dispatch_event(self, *args) != False: File "C:\Python\Python36\lib\site-packages\pyglet\event.py", line 408, in dispatch_event if handler(*args): File "C:/Python/Python36/Dhruve and me/Pyglet/skybox look.py", line 16, in on_draw look.blit(0,0) File "C:\Python\Python36\lib\site-packages\pyglet\image\__init__.py", line 1614, in blit glInterleavedArrays(GL_T4F_V4F, 0, array) File "C:\Python\Python36\lib\site-packages\pyglet\gl\lib.py", line# 107, in errcheck raise GLException(msg) pyglet.gl.lib.GLException: None
The image happens to be a skybox which displays fine when viewed by windows explorer. I'm on windows10 and python36.