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

Started by
2 comments, last by utilae 18 years, 11 months ago
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?

HTML5, iOS and Android Game Development using Corona SDK and moai SDK

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;		}
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.
@njpaul
Ok, thanks. I'll use the function ShowCursor to hide the cursor.

HTML5, iOS and Android Game Development using Corona SDK and moai SDK

This topic is closed to new replies.

Advertisement