On 8/19/08, Price Hall <[EMAIL PROTECTED]> wrote:
> Here is an example of doing multitexture with pyglet (without using
>  pyglet.graphics).

Thanks.  Keep in mind that multitexturing requires GL 1.3 or later
(your program should check for this), and the maximum number of
texture coordinates should be queried (though obviously 2 should be
supported everywhere!).

>
>  What do you think of the way I did glGenTextures?  I just took a stab
>  at it, and it worked.

> texture0 = pyglet.resource.image('texture1.png')
> texture1 = pyglet.resource.image('texture2.png')
> texNames = [texture0.id, texture1.id]
> glGenTextures(2, (GLuint * len(texNames))(*texNames))

The resource.image() call generates the texture names, then uploads
the texture data.  Then you create a list (texNames) of these texture
names, and call glGenTextures on a copy of that list; generating two
_new_ texture names (which you don't use).  The list that you gave to
glGenTextures is then discarded, ensuring you can never release or use
the two texture names you just gave it.

(Hint: you don't need to call glGenTextures).

Alex.

--~--~---------~--~----~------------~-------~--~----~
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