On Tue, Oct 14, 2008 at 2:48 PM, Noyan Tokgozoglu
<[EMAIL PROTECTED]> wrote:
>
> Hello again, I am trying to load an image and display it on a texture,
> then draw on it. But I can't load the image, I get an error saying:
>
> Traceback (most recent call last):
> File "drawerogl.py", line 544, in <module>
> if __name__ == '__main__': main()
> File "drawerogl.py", line 522, in main
> draw()
> File "drawerogl.py", line 306, in draw
> tex.blit_into(image,0,0,0)
> File "C:\Python25\Lib\site-packages\pyglet\image\__init__.py", line
> 1598, in b
> lit_into
> source.blit_to_texture(self.target, self.level, x, y, z)
> File "C:\Python25\Lib\site-packages\pyglet\image\__init__.py", line
> 473, in bl
> it_to_texture
> raise ImageException('Cannot blit %r to a texture.' % self)
> pyglet.image.ImageException: Cannot blit <TextureRegion 683x620> to a
> texture.
>
> and the code I use to blit it is:
>
>
> # if there is a loaded picture, blit it into tex
> if image:
> glBindTexture(GL_TEXTURE_2D,image.id)
> tex.blit_into(image,0,0,0)
>
I haven't read all you code honestly ;) But ... I think this will
work for you:
tex.blit_into(image.get_texture(),0,0,0)
N.B. You do not need the glBindTexture() call.
Drew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---