| 31 | } |
| 32 | |
| 33 | bool HandleMouseEventButton(const SDL_Event &event, UiButton *button) |
| 34 | { |
| 35 | if (event.button.button != SDL_BUTTON_LEFT) |
| 36 | return false; |
| 37 | switch (event.type) { |
| 38 | case SDL_MOUSEBUTTONUP: |
| 39 | button->action(); |
| 40 | return true; |
| 41 | case SDL_MOUSEBUTTONDOWN: |
| 42 | button->pressed = true; |
| 43 | return true; |
| 44 | default: |
| 45 | return false; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | void HandleGlobalMouseUpButton(UiButton *button) |
| 50 | { |