How do you create your own cursor and replace the windows mouse cursor?
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?
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; }
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement