Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Here are some general guidelines for scene object behavior:

When nesting other objects, the iterate, init and setup orders of invocation _must_ be in the same order! Meaning, if you initialize sub-object 1, then sub-object 2 in init, you must also setup sub-object 1 before sub-object 2 in setup.

This is because the thread pointer changes have to move in lockstep in those functions, allowing us to do without an offset variable.

In related news, when writing a wrapper like Bound, make sure you account for the stack pointer change from the second offset - even if you bail early! Look at Bound for an example of how to do that.

Generally, only init() should access the class itself. All data needed in setup (and next, obviously) should come from the cache structure. This prevents cache misses in the main rendering process.