On Mon, Feb 9, 2009 at 6:05 AM, Martin O'Leary <[email protected]>wrote:

> 2009/2/9 __doc__ <[email protected]>
>
>>
>> On Feb 9, 1:01 am, "Martin O'Leary" <[email protected]> wrote:
>> > Is there any chance of an interface being exposed to do this in future?
>> It
>> > seems like a fairly common use case, and while doing it yourself each
>> time
>> > yields the same end result, it would make things easier if there was a
>> > standardised way of dealing with it. If nothing else it would simplify
>> the
>> > interface when dealing with complex repeated drawables.
>>
>> I think what you're asking is how to structure your application
>> dealing with many drawable objects. Tacking some interface on batches
>> will probably not make that question go away. Scenegraphs are often
>> used to deal with it, maybe that's what you search.
>
>
> Thanks, I'm familiar with scenegraphs, but I think you're talking about a
> subtly different question to the one I am.
>
> The question isn't so much how to structure my application, but how to
> structure the interface I expose to others. If I'm implementing a drawable
> class, the user will expect to be able to pass batch and group parameters,
> as with other Pyglet drawables, and to have it do the right thing.
> Internally, I know that it's much more efficient if we can share vertex
> lists between instances, but the user doesn't know this, and really
> shouldn't need to deal with it unless they want to. I'd rather sacrifice a
> little efficiency for a unified interface.
>
> Martin
>

In my case, I expose a resource manager, and then pass resources by string.
This way the resource manager ensures that each time a resource name is
requested, the same resource is returned (texture, resources, models). The
user can still screw things up, by registering the same resource under a
bunch of different names, but at that point I assume they have a reason :)

-- 
Tristam MacDonald
http://swiftcoder.wordpress.com/

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