void CGUIControl::processPointingState(const GsRect<float> &rect) { GsPointingState &pointingState = gPointDevice.mPointingState; const bool hasPoint = rect.HasPoint(pointingState.mPos); const bool bDown = (pointingState.mActionButton>0); mReleased = false; if(!bDown && mPressed) { mPressed = false; if(hasPoint) { mReleased = true; } } if(!bDown || mPressed) { mHovered = hasPoint; } if(mHovered && bDown) { mPressed = true; } }
bool checkSandwichMenuClicked(GsRect<float> &rRect) { GsPointingState &pointingState = gPointDevice.mPointingState; const bool hasPoint = rRect.HasPoint(pointingState.mPos); const bool bDown = (pointingState.mActionButton > 0); if(bDown && hasPoint) { return true; } else { return false; } }