mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 06:06:35 +00:00
Examples: SDL: Using SDL_WINDOW_INPUT_FOCUS instead of SDL_WINDOW_MOUSE_FOCUS (which is ~~hovered). We should use SDL_CaptureMouse + SDL_WINDOW_MOUSE_CAPTURE_FLAG which requires SDL 2.0.4 will give it a try shortly. (#1559)
This commit is contained in:
parent
74dc70c543
commit
ce17e0f274
@ -274,7 +274,7 @@ void ImGui_ImplSdlGL2_NewFrame(SDL_Window *window)
|
||||
// (we already got mouse wheel, keyboard keys & characters from SDL_PollEvent())
|
||||
int mx, my;
|
||||
Uint32 mouseMask = SDL_GetMouseState(&mx, &my);
|
||||
if (SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_FOCUS)
|
||||
if (SDL_GetWindowFlags(window) & SDL_WINDOW_INPUT_FOCUS)
|
||||
io.MousePos = ImVec2((float)mx, (float)my);
|
||||
else
|
||||
io.MousePos = ImVec2(-FLT_MAX,-FLT_MAX);
|
||||
|
@ -385,7 +385,7 @@ void ImGui_ImplSdlGL3_NewFrame(SDL_Window* window)
|
||||
// (we already got mouse wheel, keyboard keys & characters from SDL_PollEvent())
|
||||
int mx, my;
|
||||
Uint32 mouseMask = SDL_GetMouseState(&mx, &my);
|
||||
if (SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_FOCUS)
|
||||
if (SDL_GetWindowFlags(window) & SDL_WINDOW_INPUT_FOCUS)
|
||||
io.MousePos = ImVec2((float)mx, (float)my);
|
||||
else
|
||||
io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
||||
|
Loading…
Reference in New Issue
Block a user