J
jimmy
Hi,
I have a main loop like this:
while (true) {
receive();
update();
draw();
}
Each stage (i.e. receive, update, draw) uses info from the previous
stage. I am currently passing this info with "transport variables".
These variables are set in one stage, and in the next, read and
cleared.
I find this very cumbersome and prone to errors (especially if I forget
to clear a variable). Is there some sort of design pattern or idiom
that could help?
Note: Each stage is infact traversing a tree so someLeaf.draw() would
not be called immediately after someLeaf.update().
-Jimmy
I have a main loop like this:
while (true) {
receive();
update();
draw();
}
Each stage (i.e. receive, update, draw) uses info from the previous
stage. I am currently passing this info with "transport variables".
These variables are set in one stage, and in the next, read and
cleared.
I find this very cumbersome and prone to errors (especially if I forget
to clear a variable). Is there some sort of design pattern or idiom
that could help?
Note: Each stage is infact traversing a tree so someLeaf.draw() would
not be called immediately after someLeaf.update().
-Jimmy