0
只要按住鼠標右鍵,我想放大對象。現在的問題是每次我想放大時都必須點擊它。有沒有辦法修改我的代碼,以便在按住按鈕的同時縮放它,而不是點擊它?GLUT鼠標按鈕向下
void mouse(int button, int state, int x, int y)
{
// Save the left button state
if (button == GLUT_LEFT_BUTTON)
{
leftMouseButtonDown = (state == GLUT_DOWN);
zMovement += 0.1f;
}
else if (button == GLUT_RIGHT_BUTTON)
{
leftMouseButtonDown = (state == GLUT_DOWN);
zMovement -= 0.1f;
}
// Save the mouse position
mouseXPos = x;
mouseYPos = y;
}
阿其如此明顯,當你拼出來一樣,(感謝變量提醒過:P)這工作太好了,謝謝 – user2757842 2014-12-03 16:08:00