diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-03-19 07:00:48 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-03-19 07:02:05 (EDT) |
commit | 9aa2cdf85381afe4e139174d8ddc9f23de60a066 (patch) | |
tree | 9a3e49cef907f1f681df5451f3183e07d3dc9c1e | |
parent | 7dbdadbebcd8aa7708d416c839d11cba512d5014 (diff) | |
download | dodge-balls-9aa2cdf85381afe4e139174d8ddc9f23de60a066.zip dodge-balls-9aa2cdf85381afe4e139174d8ddc9f23de60a066.tar.gz dodge-balls-9aa2cdf85381afe4e139174d8ddc9f23de60a066.tar.bz2 |
main-menu: Handle mouse button events
-rw-r--r-- | src/main-menu.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main-menu.c b/src/main-menu.c index 75d2ce0..93c816d 100644 --- a/src/main-menu.c +++ b/src/main-menu.c @@ -345,6 +345,16 @@ db_main_menu(void) } } break; + case SDL_MOUSEBUTTONUP: + if (event.button.button != SDL_BUTTON_LEFT) { + break; + } + if (db_pt_in_rect(event.button.x, + event.button.y, + &active->rect)) { + active->action(active->user_data); + } + break; default: break; } |