// (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
doublemouse_x,mouse_y;
glfwGetCursorPos(GWindow,&mouse_x,&mouse_y);
glfwGetCursorPos(g_window,&mouse_x,&mouse_y);
mouse_x*=(float)display_w/w;// Convert mouse coordinates to pixels
mouse_y*=(float)display_h/h;
io.MousePos=ImVec2((float)mouse_x,(float)mouse_y);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
io.MouseDown[0]=GMousePressed[0]||glfwGetMouseButton(GWindow,GLFW_MOUSE_BUTTON_LEFT)!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
io.MouseDown[0]=g_mouse_pressed[0]||glfwGetMouseButton(g_window,GLFW_MOUSE_BUTTON_LEFT)!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
// (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
doublemouse_x,mouse_y;
glfwGetCursorPos(GWindow,&mouse_x,&mouse_y);
glfwGetCursorPos(g_window,&mouse_x,&mouse_y);
mouse_x*=(float)display_w/w;// Convert mouse coordinates to pixels
mouse_y*=(float)display_h/h;
io.MousePos=ImVec2((float)mouse_x,(float)mouse_y);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
io.MouseDown[0]=GMousePressed[0]||glfwGetMouseButton(GWindow,GLFW_MOUSE_BUTTON_LEFT)!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
io.MouseDown[0]=g_mouse_pressed[0]||glfwGetMouseButton(g_window,GLFW_MOUSE_BUTTON_LEFT)!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.