Advertisement
Guest User

Untitled

a guest
Dec 11th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. void Intro::handle_events() {
  2.     SDL_Event event;
  3.     while(SDL_PollEvent(&event)) {
  4.         if(event.type == SDL_QUIT)   //If you want to exit the program, click the X on the window.
  5.             global::vars.curState = STATE_EXIT;
  6.         else if(event.type == SDL_KEYDOWN)
  7.             global::vars.videostate = STATE_FADEOUT;
  8.  
  9.         else if(event.type == SDL_JOYBUTTONDOWN) {
  10.             if(event.jbutton.which == global::vars.gamepad)  //global::vars.gamepad is an SDL_JoystickID
  11.                 global::vars.videostate = STATE_FADEOUT;
  12.         }
  13.            
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement