How can I reduce the time to blit to a texture?
The size is 446x285 but takes 0.88 to 1.7 seconds to blit to texture.
I am using the method used in the media player sample.

The code I use, and is called in the program loop. The source
(surf_clip) is a cairo image surface.

        s = str(surf_clip.get_data())
        pitch = sw * len('BGRA') * -1
        imagedata = image.ImageData(sw, sh, 'BGRA', s,pitch )

        texture = self.texture
        glBindTexture(texture.target, texture.id)

        #rx and ry = 0, will be used to update only part that changed

        imagedata.blit_to_texture(texture.target, 0, rx, ry, 0)

And the self.texture exactly like media/video:

    def _get_texture(self):
        if not self._texture:
            glEnable(GL_TEXTURE_2D)
            texture = image.Texture.create_for_size(GL_TEXTURE_2D,
                self.width, self.height, GL_RGB)
            if texture.width != self.width or texture.height !=
self.height:
                self._texture = texture.get_region(
                    0, 0, self.width, self.height)
            else:
                self._texture = texture
        return self._texture
    texture = property(_get_texture)


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