Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Intro::handle_events() {
- SDL_Event event;
- while(SDL_PollEvent(&event)) {
- if(event.type == SDL_QUIT) //If you want to exit the program, click the X on the window.
- global::vars.curState = STATE_EXIT;
- else if(event.type == SDL_KEYDOWN)
- global::vars.videostate = STATE_FADEOUT;
- else if(event.type == SDL_JOYBUTTONDOWN) {
- if(event.jbutton.which == global::vars.gamepad) //global::vars.gamepad is an SDL_JoystickID
- global::vars.videostate = STATE_FADEOUT;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement