Feel free to check my blog and send me an email if you are interested. I have work in progress version for Windows and Linux, but no documentation yet. It will be released(free and open-source) by end of this year.
Feel free to check my blog and send me an email if you are interested. I have work in progress version for Windows and Linux, but no documentation yet. It will be released(free and open-source) by end of this year.
Consider this trivial counterexample:
int counter = 0;
label("count: %d\n", counter);
if(button("increase")) { counter += 1; }
label("count: %d\n", counter);
This is, of course, a silly little example but the same issue will arise in many practical use cases and would be much more complicated.Most applications "solve" this by rendering new frames continuously, so the inconsistent state is only shown for one frame and will quickly disappear. This, however, has terrible power consumption implications if nothing of interest is occuring on the screen.
SkyAlt would "solve" your example by quickly redrawing the frame. The power consumption is good because it's redrawing only when the key is pressed or the mouse is moving, otherwise one frame every two seconds, so CPU is most of the time under 1% and my 3.6GHz CPU is running on 1.4GHz.
//initialization
int counter=0;
//each frame
label("count: %d\n", counter);
label("count again, in case you missed the other label: %d\n", counter);
if(button("increase")) { counter += 1; }
or, if the order of widgets is constrained, to buffer values: //initialization
int counter_old=0;
int counter_new=0;
//each frame
counter_old = counter_new;
label("count: %d\n", counter_old);
if(button("increase")) { counter_new = counter_old+1; }
if(button("decrease")) { counter_new = counter_old-1; }
label("count again, in case you missed the other label: %d\n", counter_old);