make mouse movement and capture depend on window focus
This commit is contained in:
@ -42,6 +42,16 @@ static int event_callback(void *userdata, SDL_Event *event) {
|
||||
ctx.resync_flag = true;
|
||||
break;
|
||||
|
||||
case SDL_WINDOWEVENT_FOCUS_LOST: {
|
||||
ctx.window_mouse_resident = false;
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED: {
|
||||
ctx.window_mouse_resident = true;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -706,6 +716,7 @@ static bool initialize(void) {
|
||||
*/
|
||||
|
||||
ctx.render_double_buffered = true;
|
||||
ctx.window_mouse_resident = true;
|
||||
|
||||
return true;
|
||||
|
||||
|
Reference in New Issue
Block a user