Hi all! I've found a really weird problem. When I run this code:
import pyglet
pyglet.resource.path = ["data"]
pyglet.resource.reindex()
image = pyglet.resource.image("chair.png")
win = pyglet.window.Window()
batch = pyglet.graphics.Batch()
sprite = pyglet.sprite.Sprite(image,batch=batch)
@win.event
def on_draw():
win.clear()
batch.draw()
pyglet.app.run()
My X server dies (locks up and flickers). But when I run this:
import pyglet
image = pyglet.image.load("data/chair.png")
win = pyglet.window.Window()
batch = pyglet.graphics.Batch()
sprite = pyglet.sprite.Sprite(image,batch=batch)
@win.event
def on_draw():
win.clear()
batch.draw()
pyglet.app.run()
Everything is fine. I suspect it has something to do with "image"
being a TextureRegion instead of an AbstractImage, but I'm lost as to
why this difference would cause the app to fail so severely.
Oddly enough, I get the same error when I add this to working app:
print image.texture
Weird! It seems like even accessing the memory with the texture flips
it out, but, again, no idea why this'd be such a major issue.
I'm running pyglet 1.1.2 under Ubuntu Intrepid on a Dell Studio 15.
chair.png is a 24x24 pixel PNG.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---