gfx-rs / gfx_scene

deprecated
Apache License 2.0
15 stars 1 forks source link

Abstract the Entity container #1

Closed kvark closed 9 years ago

kvark commented 9 years ago

Currently, a scene has Vec<Entity> in it. It would be great to allow the user to provide it's own container there, so our interfaces only take an immutable iterator of the Entity.

kvark commented 9 years ago

@csherratt - could you show me where and how you organize entities in SnowMew? I need to understand the use case better.

kvark commented 9 years ago

We just need to move the major part of Scene::draw body into a separate function.

kvark commented 9 years ago

Hmm... a standalone function is not implementable in a fun way. It needs to accept an iterator over entities, which requires a lifetime, which get required by each of the involved traits and their associated types. The declaration would cover the whole code page...

kvark commented 9 years ago

I had to add a gigantic where clause to fight with lifetime constraints. Posted about it on reddit to get some help, though I'll unlikely be able to respond to anything tomorrow.