Triangle345 / GT

Go Graphics/Game engine
MIT License
5 stars 2 forks source link

Rework of Scene and Window #23

Open Triangle345 opened 8 years ago

Triangle345 commented 8 years ago

Seems counter intuitive that Scene takes a Window object? Maybe it should be other way around?

kmfarley11 commented 8 years ago

I don't think it is terribly un-intuitive. To me it is like having linked item which references its parent as well as its children, which is not uncommon at all.

I also do not think that the Window should have a Scene object because this implies that the game only has one scene. If we were to do this then it would need to be some sort of temporary object or reference such as a "CurrentScene" or something to that effect. This way the code tells us that a scene can be rendered to a window and that there could be more than one scene, but that they occur one at a time. They are not necessarily dependent on one another so I don't think there is any need to make them become (or appear) coupled.