ソースを参照

Examples: DirectX9-10-11: Only call Windows' SetCursor(NULL) when io.MouseDrawCursor is set (#585, #909)

ocornut 8 年 前
コミット
7c2b35704d

+ 2 - 1
examples/directx10_example/imgui_impl_dx10.cpp

@@ -573,7 +573,8 @@ void ImGui_ImplDX10_NewFrame()
     // io.MouseWheel : filled by WM_MOUSEWHEEL events
     // io.MouseWheel : filled by WM_MOUSEWHEEL events
 
 
     // Hide OS mouse cursor if ImGui is drawing it
     // 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
     // Start the frame
     ImGui::NewFrame();
     ImGui::NewFrame();

+ 2 - 1
examples/directx11_example/imgui_impl_dx11.cpp

@@ -576,7 +576,8 @@ void ImGui_ImplDX11_NewFrame()
     // io.MouseWheel : filled by WM_MOUSEWHEEL events
     // io.MouseWheel : filled by WM_MOUSEWHEEL events
 
 
     // Hide OS mouse cursor if ImGui is drawing it
     // 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
     // Start the frame
     ImGui::NewFrame();
     ImGui::NewFrame();

+ 2 - 1
examples/directx9_example/imgui_impl_dx9.cpp

@@ -339,7 +339,8 @@ void ImGui_ImplDX9_NewFrame()
     // io.MouseWheel : filled by WM_MOUSEWHEEL events
     // io.MouseWheel : filled by WM_MOUSEWHEEL events
 
 
     // Hide OS mouse cursor if ImGui is drawing it
     // 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
     // Start the frame
     ImGui::NewFrame();
     ImGui::NewFrame();