How to hide the mouse?
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
ShowCursor (FALSE);
false is a C++ bool, FALSE is a Win32 BOOL. There''s a difference.
Why you shouldn''t use iostream.h - ever! | A Good free online C++ book
false is a C++ bool, FALSE is a Win32 BOOL. There''s a difference.
Why you shouldn''t use iostream.h - ever! | A Good free online C++ book
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement