[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-games-devel
Subject:    Re: [Kde-games-devel] QCanvasSprite + QObject
From:       Philippe Fremy <pfremy () chez ! com>
Date:       2001-12-15 10:19:15
[Download RAW message or body]


> > the same time? My program doesn't compile when I do. I've written my
> > own sprite class, derived from QObject. I started having trouble when I
> > wanted to use collision detection; to use RTTI, I have to derive from
> > QCanvasItem.
>
> I've done exactly this in Boson, you may want to check. IIRC the Qt doc
> has some info about that. Particulary, you need to put the QObject first
> in the inheritance list :
>

There is a reason why Warwick has choosen not to have CanvasSprites 
inherting from QObject. QOjbects are big and might slow down the canvas 
processing if you have many of them (which is usually the case with a 
Canvas).

If you ever experience very slow games, you could move from a signal/slot 
communication to an event driven communcation : define a new 
QCanvasSpriteEvent with the info you would put inside the signal, put this 
event on the Qt event list and get the event elsewhere in your canvas. It 
should be quicker than signal/slot although slightly more complicated.

	regards,

	Philippe


	regards,

	Philippe
_______________________________________________
kde-games-devel mailing list
kde-games-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-games-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic