Re: How to get the initial mouse coords before moving the mouse?
"Faluk" <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <[email protected]> |
Andre wrote: > > > 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. > _______________________________________________ > SDL mailing list > [email protected] > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org Maybe is the library you are using. Your same code is is working perfectly for me: Code: init: 92, 120 move: 92, 120 move: 88, 114 move: 81, 103 move: 71, 89 move: 43, 52 move: 17, 23 move: 0, 0 _______________________________________________ SDL mailing list [email protected] http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org