Ok, I will explain what I want to do. I have made my own GUI system using
SDL+OpenGL. I want when a user presses a button the cursor to remain still
until the user releases the button (if you have played with the rotate
button of Lightwave you might get a clue of what I wanna do). Under linux,
if the mouse button is pressed and dragged out of the SDL window, then the
window loses its focus. Under Microsoft windows this does not happen…On Tue, 21 Aug 2001, Ryan C. Gordon wrote:
One solution would be to Wrap the mouse to the position each frame, but if
the frame rate is low (e.g. with OpenGL) then the mouse cursor moves
during the subsequent calls of the wrap function.SDL_ShowCursor(SDL_DISABLE), then draw your own mouse cursor. This gives
you complete control of the rendering, it looks the same on every
platform, etc.Warping the mouse every frame is inefficient, and causes an unwanted
mousemotion event to boot.Also, you might want to consider if the user will like the control of
their mouse pointer being restricted arbitrarily. Unless you’ve got a good
reason, it’ll probably be somewhat annoying from a usability standpoint,
but then again, I don’t know what exactly you have in mind, so I shouldn’t
speak.–ryan.
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl