Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

app.setOverrideCursor() takes too much cpu

$
0
0
Hiho, everybody again :) I’m programming a strategy game with the Irrlicht 3D Engine, and use QT for the interface. For showing the player if he would select a unit by left click, the cursor changes as soon as it is over a unit. It works very well if I just move the cursor over one unit. But if I have a bunch of units in a row and move the camera eg. from the left to the right and pass all these units, the camera movement slows down a little bit because the cursor has to change very often. I declared the cursors as follows: QCursor * blue = new QCursor(*(new QPixmap("../media/interface/cursor_blue.gif"))); QCursor * green = new QCursor(*(new QPixmap("../media/interface/cursor_green.gif"))); QCursor * yellow = new QCursor(*(new QPixmap("../media/interface/cursor_yellow.gif"))); and change it with: app.setOverrideCursor(*blue); or yellow or green. As I can see its only a pointer and the images should already have been loaded so why does the game slows down? Is there a better way to acchieve what I want? Thanks in advance and best regards Ritschratsch

Viewing all articles
Browse latest Browse all 18427

Trending Articles