Guest User

SDL

a guest
May 1st, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. int quit = 0;
  2.     SDL_ShowCursor(1);
  3.     while (!quit)
  4.     {
  5.         while (SDL_PollEvent(&event))
  6.         {
  7.             switch(event.type)
  8.             {
  9.  
  10.             case SDL_MOUSEBUTTONDOWN:
  11.                 cout<<event.button.button<<endl;
  12.                 if (event.button.button == SDL_BUTTON_LEFT and event.button.state == SDL_PRESSED )
  13.                 {
  14.                     action(event.button.x, event.button.y );
  15.                     update_interface(ekran);
  16.                 }
  17.                 break;
  18.             case SDL_KEYDOWN:
  19.                 quit = 1;
  20.                 break;
  21.             }
  22.  
  23.  
  24.         }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment