Hide Mouser Cursor

Started by
3 comments, last by microdot 18 years, 9 months ago
I'm using the NeHe base code.. When windowed I can use ShowCursor(FALSE); to hide the Cursor, but when in Full screen mode this function has no effect. Has any one else noticed this, found a solution?
Advertisement
I have not seen any problems like this. The effect of the ShowCursor() during fullscreen mode is to eliminate the cursor. Are you saying that the cursor is still there during fullscreen mode? If that is the case, then maybe you are not using ShowCursor() in the correct place.

[Edited by - inferno82 on July 19, 2005 7:31:43 AM]
Check the return value. There's a display counter for the cursor and the cursor won't be hidden until the counter is zero. ShowCursor only increments and decrements that counter.

This might work better than simply calling ShowCursor.
while ( ShowCursor ( FALSE ) > 0 ) ;

edit:
Alternatively, if you're never going to need to the cursor or you plan on rendering your own (using OpenGL for example) you could create your window with an transparent cursor.

[Edited by - microdot on July 19, 2005 7:38:06 AM]
<span class="smallfont">That is not dead which can eternal lieAnd with strange aeons even death may die.   -- "The Nameless City" - H. P. Lovecraft</span>
Thansk, I've not yet tried your advice... but I use the cursor to select things in the window.. When the user holds the middle mouse button I hide the mouse and do rotations. When they lift the mouse button I show the mouse again. It's all fine when the display is windowed but not full screen.
I see. Here's another alternative you could try.
// this goes at the beginning of the window procedure.static HCURSOR cursor_handle = 0 ;// when the button is pressedcursor_handle = SetCursor ( 0 ) ;// when the button is releasedSetCursor ( cursor_handle ) ;
<span class="smallfont">That is not dead which can eternal lieAnd with strange aeons even death may die.   -- "The Nameless City" - H. P. Lovecraft</span>

This topic is closed to new replies.

Advertisement