| 70 | } |
| 71 | |
| 72 | void mouseInputButton(int button, int state, int x, int y) |
| 73 | { |
| 74 | if (button == GLUT_LEFT_BUTTON) |
| 75 | { |
| 76 | if (state == GLUT_DOWN) |
| 77 | { |
| 78 | g_MouseInput.nSelectionState = SELECTION_ACTIVE; |
| 79 | g_MouseInput.StartSelection.X = x; |
| 80 | g_MouseInput.StartSelection.Y = y; |
| 81 | } |
| 82 | else if (state == GLUT_UP && g_MouseInput.nSelectionState == SELECTION_ACTIVE) |
| 83 | { |
| 84 | // this is only a selection if mouse has moved |
| 85 | if (x != g_MouseInput.StartSelection.X && y != g_MouseInput.StartSelection.Y) |
| 86 | { |
| 87 | g_MouseInput.nSelectionState = SELECTION_DONE; |
| 88 | mouseInputCallSelection(); |
| 89 | } |
| 90 | |
| 91 | g_MouseInput.nSelectionState = SELECTION_NONE; |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | void mouseInputRegisterForSelectionRectangle(SelectionRectangleChangedPtr pFunc) |
| 97 | { |
no test coverage detected