Archived

This topic is now archived and is closed to further replies.

Punx

Displaying your own mouse cursor

Recommended Posts

I''m using Visual C++ and DirectX7 and I was wondering what the best way to create my own cursor. I was thinking of making a CCursor class which would hold the coordinates and surface to get image from. Then once a frame check for any change in coordinates, update coordinates and then blit the surface at that position. Is this the best way to do this or is their another, better way?

Share this post


Link to post
Share on other sites
a little easier way is to keep 2 variables, say MouseX and MouseY, and just update them with in your DirectInput loop.

like MouseX+=Mouse.lX; (You will need to add some sort of clipping, like if(MouseX>800)Mousex=800; (or whatever your screen coordcs are)

Then all you have to do is blit your mouse graphic using the MouseX and MouseY veriables.

Good luck!

Share this post


Link to post
Share on other sites