[Scummvm-devel] ATTN porters: updateScreen() OSystem method
marcus at mc.pp.se
Tue Apr 18 04:43:03 CEST 2006
Eugene Sandulenko <sev at scummvm.org> writes:
> [...] However, now we may call updateScreen() too
> often, that's why I started this thread.
Ok, if this is the only problem we have (and anticipate), then I agree
to the solution. :-)
The engine is the only layer which knows for sure when it is "safe" to
redraw the screen (i.e. witout getting a half-rendered scene
displayed), so it's only fair that it notifies the backend of these
points in time. Of course, when there is no rendering going on there
will be a continuum of such points, but if it is agreed that the
engine should approximate this continuum with a series of points at
arbitrary (but short, typically < 1/60s) intervals, it should work ok.
How to find the ideal interval would still be an open question
though. Modern CRTs often use refresh rates at 100Hz or over, so for
maximum smoothness of cursor updates on such screens an interval of
<10ms would be required. OTOH, picking an interval which is too short
would lead to unnecessary load on low end (battery-powered) devices...
(Even if the backend decides that it is too soon to render, there
would still be the call, so the CPU needs to be revived from any
More information about the Scummvm-devel