thecplusplusguy

SDL example

Sep 4th, 2011
2,403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1.  
  2. //http://www.youtube.com/user/thecplusplusguy
  3. #include <SDL/SDL.h>
  4.  
  5. int main(int argc,char** argv)
  6. {
  7.     SDL_Init(SDL_INIT_EVERYTHING);
  8.     SDL_Surface* screen;
  9.     screen=SDL_SetVideoMode(640,480,32,SDL_SWSURFACE);
  10.     bool running=true;
  11.     SDL_Event event;
  12.     while(running)
  13.     {
  14.         while(SDL_PollEvent(&event))
  15.         {
  16.             switch(event.type)
  17.             {
  18.                 case SDL_QUIT:
  19.                     running=false;
  20.                     break;
  21.             }
  22.         }
  23.         //draw here
  24.         SDL_Flip(screen);
  25.     }
  26.     SDL_Quit();
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment