SDL:
I want lock the mouse on window. I guess that is a solution, get the window coordinates and use MouseWarp function. Just I don't know how take these variables.
But if someone know another idea, explain
[SDL] [Solved] How take the coordinates of window
You can use SDL_WM_GrabInput to lock the mouse pointer inside the window
Just make sure that there is a way for the user to exit the program other than generating a SDL_QUIT event. Otherwise the user will be trapped because they can't press the X button or any key combination to escape the program. Well at least that's how it works for me on Linux. I guess Windows could be different.
SDL_WM_GrabInput(SDL_GRAB_ON);
Just make sure that there is a way for the user to exit the program other than generating a SDL_QUIT event. Otherwise the user will be trapped because they can't press the X button or any key combination to escape the program. Well at least that's how it works for me on Linux. I guess Windows could be different.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement