[Kde-games-devel] KBounce was Re: KWin4 Status

Mauricio Piacentini mauricio at tabuleiro.com
Mon Feb 19 17:25:41 CET 2007


Tomasz Boczkowski wrote:
> I have encoutered the same problems while porting kbounce to SVG.
> QGraphicsScene gets very slow when rendering large number of fast moving
> objects in high resolution. Is there any way to avoid the problem except
> porting the games back to QWidget::paint( ... )?

I just committed a partial fix to SVN, and you will see (with the tip I 
posted before) that screen updates are now good while the balls and 
moving, around 3%.

However, in this game you will run into the same problem I ran when 
porting KGoldRunner to QGV. There is no way to do partial background 
invalidation, so when you start a wall you will see full view redraws, 
and high cpu usage. In KGoldRunner we tried to get away by not using the 
background cache at all, as you can not invalidate it partially, or at 
least not with the 4.2-level QGV API, maybe it will change for 4.3. We 
implemented the individual bg tiles as sprites, but this did not work as 
well as we hoped for a number of reasons. You can read the list archives 
(for this list and qt-preview at trolltech) if you need more info on it.

For KBounce, maybe it is easier to simply use QPainter directly. Or if 
you want a lighter canvas-type interface, use KGameCanvas (as used by 
KGoldRunner and KMahjongg in the current SVN, code in libkdegames 
subdirectory.) If you want help let me know.

Regards,
Mauricio Piacentini


More information about the kde-games-devel mailing list