Before we can implement a button, we need to learn how to use mouse input in SDL. The code we used to get the keyboard input is in our main.cpp file. Inside the input function, you will find a call to SDL_PollEvent, followed by a few different switch statements. The first switch statements check the event.type for SDL_KEYDOWN. The second switch checks event.key.keysym.sym to see which key we pressed:
if( SDL_PollEvent( &event ) ){
switch( event.type ){
case SDL_KEYDOWN:
switch( event.key.keysym.sym ){
case SDLK_LEFT:
left_key_down = true;
break;
case SDLK_RIGHT:
right_key_down = true;
break;
case SDLK_UP:
up_key_down = true;
break;
case SDLK_DOWN:
down_key_down...