[Lazarus] Animation library
José Mejuto
joshyfun at gmail.com
Mon Feb 27 16:05:52 CET 2017
El 27/02/2017 a las 15:15, Graeme Geldenhuys via Lazarus escribió:
> The sample program runs and all animations (except "Alpha bend this
> form" functionality) works. Two points though:
Hello,
I don't know of the alpha blend form is possible in Linux and using you
windows manager.
>
> 1) The FPS counter in the form title doesn't seem to function. Instead
> of a FPS counter it seems to simply be a counter that constantly
> grows.
Hmmm... I must review it, in Windows works but maybe in Linux (not using
getperformancecounter) it simply goes crazy.
> 2) I have a 4 core system with hyper threading (ie: 4 cores and 4
> virtual cores). Your sample application maxed out all 8 cores at
> 100% CPU load. Not really acceptable behaviour for a desktop
> application I would think. ;-)
The library animate controls properties, like position and color at the
rate set by the "tmrAnimationCadence" timer. Maybe Linux LCL takes ages
to update control positions or the backend widgetset. The CPU use for
the library operations are almost 0% but repaint the form is CPU
intensive specially in Linux, based in your observations. There is no
reason that more than one core is used (no threading) so the widgetset
or LCL interface is pushing it to its limits.
You can try to remove the "Self.Refresh" in the tmrAnimationCadence
event and also raise the tmrAnimationCadence.Interval to 30 (in the
published code its value is 1, but it should be 15, but in Windows
difference between 15 and 1 is zero, in Linux you can set timers with 1
ms. precision which is terrible overkill).
--
More information about the Lazarus
mailing list