Jump to content
  • Advertisement

Archived

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

WarMachine

How do I make the cursor dissapear?

This topic is 6089 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''m using D3D8, and I want to get rid of the annoying mouse cursor in my keyboard only games. I called ShowCursor(FALSE) from my d3d device, but the mouse cursor was still there.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
To get rid of the mouse cursor completely, you need to set up DirectInput for the mouse device with exclusive access, even if you don''t plan on using it.

Share this post


Link to post
Share on other sites
Well... I''m seeing a couple of ways, but the way I use is the way KingsRevenge does
I believe it is:
ShowCursor(false);

Just thought I''d put my 2 cents in

Share this post


Link to post
Share on other sites
Unfortunately none of the above mentioned methods work in all situations (e.g. you''ll still get occasional flashes/flickers of the cursor, even in fullscreen exclusive mode with SetCursor(NULL). To work in all cases (method from Raymond Chen from Microsoft):

1. Make an icon/cursor resource file with no pixels set (i.e. totally trannsparent).

2. When registering your window class, set the cursor for your window to your blank cursor:
wcl.hCursor = LoadCursor( hInstance, IDC_BLANK );

3. SetCursor(NULL); after showing your window

4. SetCursor(NULL); when you recieve a WM_SETCURSOR message.


[The last two are for extra paranoia - the first 2 are the important part of the process].

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
ShowCursor works on a reference counting basis, IIRC it returns the current count. So

while( ShowCursor(false) >= 0 );

should always hide it. Then use the WM_ message idea.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!