On 9/17/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi Danny,
>
> We did something like this.. using PIL to load in the image, convert
> it to string data and load it into an opengl texture via the
> glTexImage2D()
>
> self.img = Image.open('image1.png')
> self.texture = self.img.tostring()
>
> width = image_width
> height = image_height
>
> glBindTexture(GL_TEXTURE_2D, 1)
> glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL)
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
> glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
> glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0,
> GL_RGB,GL_UNSIGNED_BYTE, self.texture)
>
This isn't really helpful for tracking down a memory leak -- it
completely bypasses pyglet's texture system, giving you complete
responsibility for releasing the texture later on.
>
> Thanks for the help Alex, I'll try to benchmark what this method
> calls opposed to pyglet's method.. how can I save the output to a
> file? With the logging module?
Either redirect output from your shell or redirect sys.stdout.
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
-~----------~----~----~----~------~----~------~--~---