On 23 September 2011 09:05, Douglas Bagnall <[email protected]> wrote:
> I am writing something that uses a lot of animated sprites (more video
> collage than game). The images can't all fit in video memory, and it
> needs to play smoothly.
>
> The naive approach of calling Animation.from_image_sequence() for each
> new sprite pauses everything while the images load.
>
> I can think of two approaches that might work:
>
> 1. load the frames one at a time from the event loop. (disadvantages:
> no guarantee that any particular frame is quick enough, somewhat
> complexifying).
>
> 2. load the sprites in a thread (disadvantage: ewww, threads).
>
> but it seems like an obvious problem that might have an idiomatic
> solution. Does it?
>
> I am currently using PNGs and some simple profiling shows a lot of
> time being spent in zlib, so I expect it will work better if I switch
> to DDS or something, but not enough better that I won't have to worry
> about waiting for Animation.from_image_sequence(). Or am I wrong
> there?
Would it be possible to combine the images into an actual video and
use a proper video codec? pyglet has support for reading from many
video formats (thanks to avbin) and presents the video frames to you
as a texture which may be rendered just as easily as sprites.
Richard
--
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.