Mouse capture.

Started by
6 comments, last by soldier2 18 years, 8 months ago
I have two questions: 1. When I run my DX application in fullscreen I can see my windows mouse cursor. How do I make it disappear? 2. Is there any gain in using DirectInput instead of Win32 Api for mouse and keyboard input? Thanks in advance. [Edited by - soldier2 on August 17, 2005 1:55:54 PM]
Advertisement
In Managed DirectX it would be :

Cursor.Hide();

to hide the cursor.
I am using C++.
There is a huge performance gain by using direct input. You don't have to mess with the message loop, which will slow you down.
There is a command for hiding the cursor:
ShowCursor(FALSE);

When you want to display the cursor again, you can write:
ShowCursor(TRUE);

There is a huge gain in using DirectInput instead of Win32, because the input capture is much more precise. Win32 input is quite slow, a button press can be missed if you push two buttons quickly enough. So my advice is to use DirectInput every time you need precise input capturing.
Thank`s for your help. Joni-Matti can you also tell me where do I call that function. I just took a look on MSDN but I didn`t find too much detail there.
You can call it right after initializing and showing the window. It is also good to call ShowCursor(TRUE) when you exit the program.
Works fine. Thank you. Rating ++

This topic is closed to new replies.

Advertisement