mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
tried to improve mouse focusing
This commit is contained in:
parent
8c1ed7d81d
commit
b0836b7909
|
@ -538,7 +538,7 @@ int gfx_window_active()
|
|||
#ifdef CONFIG_NO_SDL
|
||||
return glfwGetWindowParam(GLFW_ACTIVE) == GL_TRUE ? 1 : 0;
|
||||
#else
|
||||
return 1; /* TODO: SDL*/
|
||||
return SDL_GetAppState()&SDL_APPINPUTFOCUS; /* TODO: SDL*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -547,7 +547,7 @@ int gfx_window_open()
|
|||
#ifdef CONFIG_NO_SDL
|
||||
return glfwGetWindowParam(GLFW_OPENED) == GL_TRUE ? 1 : 0;
|
||||
#else
|
||||
return 1; /* TODO: SDL*/
|
||||
return SDL_GetAppState()&SDL_APPACTIVE; /* TODO: SDL*/
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ static int input_current = 0;
|
|||
static unsigned int last_release = 0;
|
||||
#else
|
||||
static int input_grabbed = 0;
|
||||
static int input_use_grab = 1;
|
||||
static int input_use_grab = 0;
|
||||
#endif
|
||||
static unsigned int release_delta = -1;
|
||||
|
||||
|
@ -296,6 +296,12 @@ void inp_update()
|
|||
#else
|
||||
int i;
|
||||
|
||||
if(input_grabbed && !gfx_window_active())
|
||||
inp_mouse_mode_absolute();
|
||||
|
||||
/*if(!input_grabbed && gfx_window_active())
|
||||
inp_mouse_mode_relative();*/
|
||||
|
||||
/* clear and begin count on the other one */
|
||||
mem_zero(&input_count[input_current], sizeof(input_count[input_current]));
|
||||
mem_copy(input_state[input_current], input_state[input_current^1], sizeof(input_state[input_current]));
|
||||
|
|
Loading…
Reference in a new issue