• CUrsor Visiblity
    2 replies, posted
[url=http://www.gamedev.net/community/forums/topic.asp?topic_id=543757]Lately I've been making a game engine and Windows doesn't have a clear function to set the cursor visible, or not visible. ShowCursor hurts my head, since I want to toggle the cursor visible and not visible now and then by a single command, setCursorVisible(bool visible), but alas, I cannot find any way to do this. Help?[/url] After two attempts, I have this non-working code. [code] void setCursorState(bool visible) { CURSORINFO info; GetCursorInfo(&info); bool currentState = info.flags == CURSOR_SHOWING; if(visible != currentState) // Take action only if current state is not what's needed. ShowCursor(visible); }[/code] The cursor is showing, but when I call it with visible = false, it doesn't do anything. It skips the if statement.
are you debugging currentState ? oh. if currentState == false, and visible == false. then that statement is never executed.
it thinks currentstate is false all the time
Sorry, you need to Log In to post a reply to this thread.