IO: io.MousePos needs to be set to ImVec2(-FLT_MAX,-FLT_MAX) when mouse is unavailable/missing. Previously ImVec2(-1,-1) was enough but we'll now accept negative mouse coordinates.
io.MousePos=ImVec2((float)mx,(float)my);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
io.MousePos=ImVec2((float)mx,(float)my);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
else
else
io.MousePos=ImVec2(-1,-1);
io.MousePos=ImVec2(-FLT_MAX,-FLT_MAX);
io.MouseDown[0]=g_MousePressed[0]||(mouseMask&SDL_BUTTON(SDL_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_MousePressed[0]||(mouseMask&SDL_BUTTON(SDL_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)mx,(float)my);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
io.MousePos=ImVec2((float)mx,(float)my);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
else
else
io.MousePos=ImVec2(-1,-1);
io.MousePos=ImVec2(-FLT_MAX,-FLT_MAX);
io.MouseDown[0]=g_MousePressed[0]||(mouseMask&SDL_BUTTON(SDL_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_MousePressed[0]||(mouseMask&SDL_BUTTON(SDL_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.
// If mouse just appeared or disappeared (usually denoted by -FLT_MAX component, but in reality we test for -256000.0f) we cancel out movement in MouseDelta
g.IO.MousePos=ImVec2(-9999.0f,-9999.0f);
constfloatMOUSE_INVALID=-256000.0f;
if((g.IO.MousePos.x<0&&g.IO.MousePos.y<0)||(g.IO.MousePosPrev.x<0&&g.IO.MousePosPrev.y<0))// if mouse just appeared or disappeared (negative coordinate) we cancel out movement in MouseDelta
ImVec2MousePos;// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
ImVec2MousePos;// Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.)
boolMouseDown[5];// Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
boolMouseDown[5];// Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
floatMouseWheel;// Mouse wheel: 1 unit scrolls about 5 lines text.
floatMouseWheel;// Mouse wheel: 1 unit scrolls about 5 lines text.
boolMouseDrawCursor;// Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
boolMouseDrawCursor;// Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).