Hi,
I keep searching for a truly cross-platform GUI framework, and feel like
it's all "bait and switch". I'm hoping there's a simple dependency fix for
the following problem.
On Linux, the following runs fine:
import pyglet
window = pyglet.window.Window()
image = pyglet.image.load("armless.svg")
sprite = pyglet.sprite.Sprite(image,
x=((window.width - image.width) / 2),
y=((window.height - image.height) / 2))
pyglet.gl.glClearColor(0.75, 0.75, 0.75, 1) # Grey opaque
@window.event
def on_draw():
window.clear()
sprite.draw()
pyglet.app.run()
On Mac OS X, I get:
*Jan 9 17:03:19 Python[18829] <Error>: CGContextDrawImage:
invalid context 0x0. If you want to see the backtrace,
please set CG_CONTEXT_SHOW_BACKTRACE environmental
variable.Traceback (most recent call last): File "fuck.py", line 17, in
<module> y=((window.height - image.height) / 2)) File
"/Library/Python/2.7/site-packages/pyglet/sprite.py", line 234, in
__init__ self._texture = img.get_texture() File
"/Library/Python/2.7/site-packages/pyglet/image/__init__.py", line 818, in
get_texture force_rectangle) File
"/Library/Python/2.7/site-packages/pyglet/image/__init__.py", line 809, in
create_texture self.anchor_x, self.anchor_y, 0, None) File
"/Library/Python/2.7/site-packages/pyglet/image/__init__.py", line 986, in
blit_to_texture data) File
"/Library/Python/2.7/site-packages/pyglet/gl/lib.py", line 104, in
errcheck raise GLException(msg)pyglet.gl.lib.GLException: invalid
operation*
Is there a simple "pip install" or "brew install" fix? (I have pillow,
libsvg, librsvg and cairo installed correctly, I think. And a version of
the above using a JPG image worked on the Mac.)
Thanks!
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.