• Advertisement
Sign in to follow this  

How do you create your own cursor and replace the windows mouse cursor?

This topic is 4681 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using C++ and DirectX9. I want to stop showing the default windows mouse cursor in my full screen app. Basically I want to draw my own mouse cursor (my cursor will be a textured 2d poly). I've got the draw texture part done (need no help with graphics). I just need to make it so that I can get the position of the mouse and then render my texture at that position. I figure that to do this I just need to make the windows mouse cursor invisibile or something. Anyone able to help?

Share this post


Link to post
Share on other sites
Advertisement
If you are using DirectInput you have to set different flags on your mouse cooperative level


if(FAILED(mouse->SetCooperativeLevel(window->GetWindow(), DISCL_FOREGROUND | DISCL_EXCLUSIVE))){
// DISCL_EXCLUSIVE - Mouse Icon Off
// DISCL_NONEXCLUSIVE - Mouse Icon On
return false;
}

Share this post


Link to post
Share on other sites
Or you can make a call to the win32 ShowCursor to hide the cursor. I suppose that when you create your window you could even tell it to use a custom cursor from a resource file. I don't know how much this affects performance though.

Share this post


Link to post
Share on other sites
@njpaul
Ok, thanks. I'll use the function ShowCursor to hide the cursor.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement