Re: How to get the initial mouse coords before moving the mouse?

Andre <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <[email protected]>
> The problem is that if the mouse is outside the window there is no data
> to get. If the SDL_GetMouseState is called while the window is inside
> the window you will get data. Try creating a bigger where the mouse is
> inside the window.

I'm not talking about the case where the mouse is outside the program.

Run my attached program. Then remember the position of the window. Close
the program. Then move the mouse into the position where the window was
created last time. Start the program again.

Now you can see that the initial call of SDL_GetMouseState always
returns (0,0) although the mouse is inside the window.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.