On 7/2/08, tomas <[EMAIL PROTECTED]> wrote:
>
>  >The sprite can be migrated from one batch to another, or removed from its 
> batch (for individual drawing). Note that this can be an expensive operation.
>  >The sprite can change its rendering group, however this can be an expensive 
> operation.
>
>  I'm just wondering what 'can be' an expensive operation means. Or
>  rather, I am wondering whether I can use the following:
>
>  1. create sprite (no group or batch)
>  2. set sprite.group and sprite.batch properties ONCE
>
>  (I need the above approach because the given batch and group of a
>  sprite cannot be determined until after I have created a sprite and
>  added it to a manager)
>
>  This won't be a problem right? I'm just asking because 'can be
>  expensive' can mean anything.

If it's possible to reorganise your code so that the batch and group
are created first, you should do so.  Doing things in the order you
describe will result in wasted effort, including allocating and
deallocating resources on the GPU (these won't even be freed until the
Python GC gets to them).

The warning above is really to discourage migrating sprites often, you
probably won't notice any performance problems in the situation you
describe (as Sprite creation is fairly slow anyway).

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