The following works for me.  Note that the first argument to
blit_to_texture is a texture target like GL_TEXTURE_2D, and is not a
Texture object.  Also the fifth argument is the data format and should
not be 0.


from pyglet.gl import *

window = pyglet.window.Window()

image = pyglet.image.load('kitten.jpg')
texture = pyglet.image.Texture.create(image.width, image.height,
GL_RGBA)
image.blit_to_texture(texture.target, 0, 0, 0, GL_RGBA)

@window.event
def on_draw():
    window.clear()
    texture.blit(0, 0)
pyglet.app.run()
-- 
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.


Reply via email to