conifer
conifer copied to clipboard
Universe
User should be able to pass a state through iterations of their callback. So far in my experiments I have added another &mut parameter to the callback so that each execution can modify the universe and remember it later. Do we want to think about the execution as centered on the universe or on the device? e.g. universe.run(config, canvas, callback)
or config.run(universe, canvas, callback)
.
i'm curious why this can't be done with Rust's capture of variables in closures?
let mut my_universe = Universe::new();
run(move |canvas,event|{
my_universe.do_something();
});