Archived

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

jimywang

How to hide the mouse?

Recommended Posts

I have done a little full screen game using DirectX 8.0.I have a problem with hiding the mouse in the game.Can anyone tell me how to hide the mouse in a Win32 full screen program plz?Thx regards

Share this post


Link to post
Share on other sites
It should be noted that ShowCursor does somthing like ''Reference Coutning'' in that if, you call ShowCursor(FALSE); 2 times
then call ShowCursor(TRUE); once it wont show the cursor.

in order to get an effect you must show as many times as you hide, so what i do is make a function that makes reference to variable.

m_cursorvisible=true;//set to true as default

void ShowCursor(bool show)
{
if(show)
{
if(!m_cursorvisible)
{
ShowCursor(TRUE);
m_cursorvisible=true;
}
}
else
{
if(m_cursorvisible)
{
ShowCursor(FALSE);
m_cursorvisible=false;
}
}
}

this will keep everything synced apropriatly.

of course the counting mechanisim is helpful if you have some weird nesting calls to the ShowCursor function, wherein you only want a change at the begining and end of the matched nest.


Raymond Jacobs,

www.EDIGames.com

www.EtherealDarkness.com

Share this post


Link to post
Share on other sites