mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-22 23:56:36 +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
examples
@ -274,7 +274,7 @@ void ImGui_ImplSdlGL2_NewFrame(SDL_Window *window)
|
|||||||
// (we already got mouse wheel, keyboard keys & characters from SDL_PollEvent())
|
// (we already got mouse wheel, keyboard keys & characters from SDL_PollEvent())
|
||||||
int mx, my;
|
int mx, my;
|
||||||
Uint32 mouseMask = SDL_GetMouseState(&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);
|
io.MousePos = ImVec2((float)mx, (float)my);
|
||||||
else
|
else
|
||||||
io.MousePos = ImVec2(-FLT_MAX,-FLT_MAX);
|
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())
|
// (we already got mouse wheel, keyboard keys & characters from SDL_PollEvent())
|
||||||
int mx, my;
|
int mx, my;
|
||||||
Uint32 mouseMask = SDL_GetMouseState(&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);
|
io.MousePos = ImVec2((float)mx, (float)my);
|
||||||
else
|
else
|
||||||
io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
io.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
||||||
|
Loading…
Reference in New Issue
Block a user