// (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
doublemouse_x,mouse_y;
glfwGetCursorPos(g_Window,&mouse_x,&mouse_y);
mouse_x*=(float)display_w/w;// Convert mouse coordinates to pixels
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]=g_MousePressed[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.
io.MousePos=ImVec2((float)mouse_x,(float)mouse_y);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
for(inti=0;i<3;i++)
{
io.MouseDown[i]=g_MousePressed[i]||glfwGetMouseButton(g_Window,i)!=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(g_Window,&mouse_x,&mouse_y);
mouse_x*=(float)display_w/w;// Convert mouse coordinates to pixels
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]=g_MousePressed[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.
io.MousePos=ImVec2((float)mouse_x,(float)mouse_y);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
for(inti=0;i<3;i++)
{
io.MouseDown[i]=g_MousePressed[i]||glfwGetMouseButton(g_Window,i)!=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.