Uint32mouse_buttons=SDL_GetMouseState(&mouse_x,&mouse_y);// NB: We don't use the x/y results from SDL_GetMouseState()
SDL_GetGlobalMouseState(&mouse_x,&mouse_y);
io.MouseDown[0]=g_MousePressed[0]||(mouse_buttons&SDL_BUTTON(SDL_BUTTON_LEFT))!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
// Single viewport mode: mouse position in client window coordinates (io.MousePos is (0,0) when the mouse is on the upper-left corner of the app window)
// Single viewport mode: mouse position in client window coordinates (io.MousePos is (0,0) when the mouse is on the upper-left corner of the app window)
// We already retrieve global mouse position, SDL_CaptureMouse() also let the OS know e.g. that our imgui drag outside the SDL window boundaries shouldn't trigger the OS window resize cursor
// The function is only supported from SDL 2.0.4 (released Jan 2016)