gfx-rs / gfx_scene

deprecated
Apache License 2.0
15 stars 1 forks source link

Abstract the space data #8

Closed kvark closed 9 years ago

kvark commented 9 years ago

Technically, it's defined by the Technique, since that's what uses the SpaceData in its implementation. However, if we make it an associated type, it becomes impossible to implement AbstractScene properly due to how draw() is defined:

fn draw<H: phase::AbstractPhase<D, Self::Entity, Self::SpaceData> + ?Sized> {...}

It has to work with any SpaceData then, while higher-level Scene would want to restrict this to another trait scene::SpaceData in order to be able to construct it.

kvark commented 9 years ago

Perhaps, we should ditch AbstractScene entirely due to it (arguably) useless interface and complexities surrounding it. It was only introduced for the PhaseHarness, which is yet to prove its usefulness either. The expected use-case is:

The PhaseHarness doesn't really help here, and neither does AbstractScene. It is meant for the more complex scenarios, where it fails too due to the lack of generality.