mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 09:27:00 +00:00
Merge pull request #174 from adamdmoss/glfwcursor
Examples: OpenGL/GLFW: hide system cursor if imgui is soft-rendering cursor
This commit is contained in:
commit
136dbdfd95
@ -351,6 +351,17 @@ void ImGui_ImplGlfwGL3_NewFrame()
|
|||||||
io.MouseWheel = g_MouseWheel;
|
io.MouseWheel = g_MouseWheel;
|
||||||
g_MouseWheel = 0.0f;
|
g_MouseWheel = 0.0f;
|
||||||
|
|
||||||
|
// Hide/show hardware mouse cursor
|
||||||
|
if (io.MouseDrawCursor)
|
||||||
|
{
|
||||||
|
// imgui draws cursor itself
|
||||||
|
glfwSetInputMode(g_Window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glfwSetInputMode(g_Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
// Start the frame
|
// Start the frame
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
}
|
}
|
||||||
|
@ -255,6 +255,17 @@ void ImGui_ImplGlfw_NewFrame()
|
|||||||
io.MouseWheel = g_MouseWheel;
|
io.MouseWheel = g_MouseWheel;
|
||||||
g_MouseWheel = 0.0f;
|
g_MouseWheel = 0.0f;
|
||||||
|
|
||||||
|
// Hide/show hardware mouse cursor
|
||||||
|
if (io.MouseDrawCursor)
|
||||||
|
{
|
||||||
|
// imgui draws cursor itself
|
||||||
|
glfwSetInputMode(g_Window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glfwSetInputMode(g_Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
// Start the frame
|
// Start the frame
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user