Is it possible to unlock the mouse in fullscreen mode so that you can use it on a another monitor? I read trough the SDL documentation, but I couldn't find anything related to my problem.
This is for SDL 2, but have you showing the cursor cursor and seeing if it can escape?
function for creating a cursor:
int SDL_ShowCursor(int toggle)
so it would be like this
look more into it here:
personally I do not have a second monitor so I cannot help you
In SDL 2 there is also
SDL_Get/SetWindowGrab which returns/sets whether or not the window is grabbing the mouse. I think this is what you want.
For SDL2 (don't use SDL1 anymore):
// to configure the window SDL_SetWindowFullscreen(my_window, SDL_WINDOW_FULLSCREEN_DESKTOP); // to unlock the mouse SDL_SetWindowGrab(my_window, false); SDL_SetRelativeMouseMode(false); // to lock the mouse SDL_SetWindowGrab(my_window, true); SDL_SetRelativeMouseMode(true);
That first sets the window to the "fake" fullscreen that is just a resolution-sized borderless window. This is necessary on Windows and some Linux setups to have a mouse cursor that can freely enter and leave the window on a multi-monitor setup.