// Set OS mouse position if requested last frame by io.WantMoveMouse flag (used when io.NavMovesTrue is enabled by user and using directional navigation)
// Set OS mouse position if requested last frame by io.WantMoveMouse flag (used when io.NavMovesTrue is enabled by user and using directional navigation)
// Set OS mouse position if requested last frame by io.WantMoveMouse flag (used when io.NavMovesTrue is enabled by user and using directional navigation)
// (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
if(glfwGetWindowAttrib(g_Window,GLFW_FOCUSED))
{
if(io.WantMoveMouse)
{
glfwSetCursorPos(g_Window,(double)io.MousePos.x,(double)io.MousePos.y);// Set mouse position if requested by io.WantMoveMouse flag (used when io.NavMovesTrue is enabled by user and using directional navigation)
}
else
{
doublemouse_x,mouse_y;
glfwGetCursorPos(g_Window,&mouse_x,&mouse_y);
io.MousePos=ImVec2((float)mouse_x,(float)mouse_y);// Mouse position in screen coordinates (set to -1,-1 if no mouse / on another screen, etc.)
io.MousePos=ImVec2((float)mouse_x,(float)mouse_y);// Get mouse position in screen coordinates (set to -1,-1 if no mouse / on another screen, etc.)
// (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
if(glfwGetWindowAttrib(g_Window,GLFW_FOCUSED))
{
if(io.WantMoveMouse)
{
glfwSetCursorPos(g_Window,(double)io.MousePos.x,(double)io.MousePos.y);// Set mouse position if requested by io.WantMoveMouse flag (used when io.NavMovesTrue is enabled by user and using directional navigation)
}
else
{
doublemouse_x,mouse_y;
glfwGetCursorPos(g_Window,&mouse_x,&mouse_y);
io.MousePos=ImVec2((float)mouse_x,(float)mouse_y);// Mouse position in screen coordinates (set to -1,-1 if no mouse / on another screen, etc.)
io.MousePos=ImVec2((float)mouse_x,(float)mouse_y);// Get mouse position in screen coordinates (set to -1,-1 if no mouse / on another screen, etc.)