sinisterchipmunk/jax — Issue #29: Stop passing Jax.Context
Author: sinisterchipmunk
Created: 2011-11-08 14:56:54+00:00
State: open

Riddle me this!

Jax is designed to work properly with multiple simultaneous contexts. Creating a new instance of `Jax.Context` will spawn new instances of `Jax.Controller` and friends. Therefore, since objects are being instantiated and not used statically, why does `Material`, `Mesh`, etc. have to pass an instance of `Jax.Context` through all of its render methods? Why aren't the objects simply assigned a `context` property that can be used anywhere, immediately after initialization?

This would remove numerous obstacles, and specifically it would allow models to eager-load their meshes. Lazy loading is effective in many situations, but sometimes eager loading is preferred (for instance, at a "loading" screen).