From 7c2b35704d6b720eb933fec0586e65487f3ad432 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 12 Nov 2016 19:46:52 +0100 Subject: [PATCH] Examples: DirectX9-10-11: Only call Windows' SetCursor(NULL) when io.MouseDrawCursor is set (#585, #909) --- examples/directx10_example/imgui_impl_dx10.cpp | 3 ++- examples/directx11_example/imgui_impl_dx11.cpp | 3 ++- examples/directx9_example/imgui_impl_dx9.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/directx10_example/imgui_impl_dx10.cpp b/examples/directx10_example/imgui_impl_dx10.cpp index c604df04..5bda68df 100644 --- a/examples/directx10_example/imgui_impl_dx10.cpp +++ b/examples/directx10_example/imgui_impl_dx10.cpp @@ -573,7 +573,8 @@ void ImGui_ImplDX10_NewFrame() // io.MouseWheel : filled by WM_MOUSEWHEEL events // Hide OS mouse cursor if ImGui is drawing it - SetCursor(io.MouseDrawCursor ? NULL : LoadCursor(NULL, IDC_ARROW)); + if (io.MouseDrawCursor) + SetCursor(NULL); // Start the frame ImGui::NewFrame(); diff --git a/examples/directx11_example/imgui_impl_dx11.cpp b/examples/directx11_example/imgui_impl_dx11.cpp index b7da6e06..0a3722eb 100644 --- a/examples/directx11_example/imgui_impl_dx11.cpp +++ b/examples/directx11_example/imgui_impl_dx11.cpp @@ -576,7 +576,8 @@ void ImGui_ImplDX11_NewFrame() // io.MouseWheel : filled by WM_MOUSEWHEEL events // Hide OS mouse cursor if ImGui is drawing it - SetCursor(io.MouseDrawCursor ? NULL : LoadCursor(NULL, IDC_ARROW)); + if (io.MouseDrawCursor) + SetCursor(NULL); // Start the frame ImGui::NewFrame(); diff --git a/examples/directx9_example/imgui_impl_dx9.cpp b/examples/directx9_example/imgui_impl_dx9.cpp index b009de75..82e638ef 100644 --- a/examples/directx9_example/imgui_impl_dx9.cpp +++ b/examples/directx9_example/imgui_impl_dx9.cpp @@ -339,7 +339,8 @@ void ImGui_ImplDX9_NewFrame() // io.MouseWheel : filled by WM_MOUSEWHEEL events // Hide OS mouse cursor if ImGui is drawing it - SetCursor(io.MouseDrawCursor ? NULL : LoadCursor(NULL, IDC_ARROW)); + if (io.MouseDrawCursor) + SetCursor(NULL); // Start the frame ImGui::NewFrame();