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)

features/sdl_renderer3_multiviewports
omar ago%!(EXTRA string=7 years)
parent 74dc70c543
commit ce17e0f274
  1. 2
      examples/sdl_opengl2_example/imgui_impl_sdl.cpp
  2. 2
      examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp

@ -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…
Cancel
Save