On Saturday, 3 May 2014 at 14:31:59 UTC, Paulo Pinto wrote:
- Make all scene graph nodes IDisposable.

- Have a using(rootNode) {} on your render loop

That would work for a static scene.

But you want to mark resources ready for release when nodes are removed from the graph dynamically. In most cases shared pointers (ref counting) would work, but if you allow "fractal" recursion then you will get cycles. (e.g. meshnode->scaleRND->rotateRND->stopIfTooSmall->meshnode )

Reply via email to