Thank you so much, that worked a treat. I didn't originally have the sprite in there and it still didn't work, I only loaded to sprite to make sure the image was loading okay, as a last ditch attempt.
It seems that it only works if I put glEnable(GL_TEXTURE_2D) directly above the glBindTexture code in draw_grid(), any where else and it fails. But at least it works now, thank you again. -Mic On Dec 22, 9:53 pm, "Alex Holkner" <[email protected]> wrote: > On 12/23/08, Mic Pringle <[email protected]> wrote: > > > > > > > Hi, > > > This issue is driving me mad so I'm reaching out the pyglet community > > to see if they can help me :-) > > > The code below draw a 10 x 10 grid of squares 64px in size, and it all > > works except the texture mapping part. All I get is grey squares, or > > white when the mouse moves over them. These colors are set on the line > > where the mouse position is tested, and are meant to alter the blend > > color of the texture. Can anyone see why the texture isn't mapping ? > > > I've tried loading different images and formats, and also loaded the > > same image as a sprite and displayed that (see below) just to make > > sure the image is being loaded okay and that works so I'm really > > starting to pull my hair out ... > > def draw_grid(): > > You need to glEnable(GL_TEXTURE_2D) each time here. Drawing the > sprite disables it, as pyglet assumes (perhaps unwisely) that this is > the default state. > > Alternatively, comment out the sprite.draw(). > > 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 -~----------~----~----~----~------~----~------~--~---
