I have a secondary monitor and it is not set to my main display. When I drag my game over to there, it locks my cursor to the main display.
This is the code i'm using:
#region Lock the cursor to gui again
//Fullscreen mode
if (window_get_fullscreen())
{
fullscreen = true;
global.display_width = display_get_width();
global.display_height = display_get_height();
display_mouse_lock(0,0,global.display_width,global.display_height);
}
//Windowed mode
else if (!window_get_fullscreen())
{
fullscreen = false;
global.window_width = window_get_width();
global.window_height = window_get_height();
global.window_x = window_get_x();
global.window_y = window_get_y();
display_mouse_lock(global.window_x,global.window_y,global.window_width,global.window_height);
}
#endregion