[SDL] Cursor disappears when moved
Mark Jenison
jenison at enteract.com
Sun Oct 15 20:21:07 PDT 2006
Ilya Olevsky <info <at> valengames.com> writes:
>
> > Is there any trick I can use to programmatically hide the mouse cursor other
> > than using SDL_ShowCursor(SDL_DISABLE)?
>
> Try this: when you get the SDL_ACTIVEEVENT event, check if you're in
> fullscreen mode and gained focus, and if so call SDL_ShowCursor
> (SDL_DISABLE). One way to check if the app gained focus is this:
>
> if(SDL_GetAppState() & SDL_APPINPUTFOCUS)
> ...
>
Thanks for the advice.
I put this check in my main code loop, and when the program starts up now, the
cursor is hidden.
However, if later something happens on the system that causes the cursor to
become an hourglass (disk access, etc), it causes the cursor to reappear. I
would think this code would correctly re-hide the cursor, but it does not. Any
other ideas?
More information about the SDL
mailing list