Discussion:
Invalidate or refresh ?
ER
2016-08-30 23:06:49 UTC
Permalink
Hi -

What is better or what should I use, Invalidate or refresh ?

For this gaming I'm working on, though not much going on right now,
I get 31-32 fps if I use GameCanvas.Refresh. I'll get 48-49 fps if I
use
GameCanvas.Refresh. (Mac OS)


Thanks.



_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xojo.com>

List Help: <***@xojo.com>
Jon Ogden
2016-08-30 23:14:52 UTC
Permalink
Invalidate marks the item as dirty so it's repainted the next time the OS finds it necessary. Refresh forces the redraw immediately. Usually invalidate is preferred.

Sent from my iPhone
Post by ER
Hi -
What is better or what should I use, Invalidate or refresh ?
For this gaming I'm working on, though not much going on right now,
I get 31-32 fps if I use GameCanvas.Refresh. I'll get 48-49 fps if I use
GameCanvas.Refresh. (Mac OS)
Thanks.
_______________________________________________
_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xojo.com>

List Help: <***@xojo.com>
ER
2016-08-31 16:05:12 UTC
Permalink
Ah I see.

Thanks.
Post by Jon Ogden
Invalidate marks the item as dirty so it's repainted the next time
the OS finds it necessary. Refresh forces the redraw immediately.
Usually invalidate is preferred.
Sent from my iPhone
_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xojo.com>

List Help: <***@xojo.com>
vaughnsc .
2016-08-30 23:23:39 UTC
Permalink
You've answered you own question, pretty much.

Invalidate flags and defers until a redraw happens in the normal course of
events, which may draw more than one invalidated area (efficiency).

Refresh is 'stop everything and draw just this, now!'

Gauge the result and favor invalidate unless you notice a delay.
Post by ER
Hi -
What is better or what should I use, Invalidate or refresh ?
For this gaming I'm working on, though not much going on right now,
I get 31-32 fps if I use GameCanvas.Refresh. I'll get 48-49 fps if I use
GameCanvas.Refresh. (Mac OS)
Thanks.
_______________________________________________
_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xojo.com>

List Help: <***@xojo.com>
ER
2016-08-31 16:19:04 UTC
Permalink
I see.

Thanks.
Post by vaughnsc .
You've answered you own question, pretty much.
Invalidate flags and defers until a redraw happens in the normal course of
events, which may draw more than one invalidated area (efficiency).
Refresh is 'stop everything and draw just this, now!'
Gauge the result and favor invalidate unless you notice a delay.
_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xojo.com>

List Help: <***@xojo.com>

Continue reading on narkive:
Loading...