[Kde-games-devel] A timer class for games

Aaron J. Seigo aseigo at kde.org
Wed Jun 17 05:42:52 CEST 2009


On Tuesday 16 June 2009, Parker Coates wrote:
> I remember that discussion about sharing a single timer tick between
> multiple QTimeLines. It's a shame to see that nothing came of it.
> (Note that QTimeLine doesn't have an internal QTimer, it uses QObjects
> timer functions directly.)

the new animation and state machine framework, however, does use a shared 
timer. and it's in a separate (though still private) class, so using it inside 
of QTimeLine should be trivial now.

> Currently in KPat, each card has its own QGraphicsItemAnimation, which
> in turn uses its own QTimeline. I suspect performance during complex
> animations could be much improved if the QTimeLines were firing all at
> once.

yes, they would be. or at least, they'd look a lot more coordinated. the 
actual performance in terms of cpu cycles probably won't differ meaningfully 
but things will actually stand a chance of animating properly since all the 
expensive graphics work for all items will be done at the same time and for 
the same step.

if you wanted to experiment with it now, you could grab the Qt Animation 
branch from git, or use one of their pre-releases, and start mucking with it.  

we're doing that now in Plasma as well. (i've been waiting for this stuff for 
about a year now, which is why there's been zero work outside of bug fixing on 
Plasma::Animator in its current state.) so you wouldn't end up being the only 
KDE app with a dependency on it for KDE 4.4 ;)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20090616/c60efbec/attachment.sig 


More information about the kde-games-devel mailing list