Advertisement
thecplusplusguy

SDL tutorial 1

Jun 22nd, 2012
2,341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. //http://www.youtube.com/user/thecplusplusguy
  2. //Thanks for the typed in code to Tapit85
  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. //  screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE|SDL_FULLSCREEN);
  11.     bool running = true;
  12.     while(running) {
  13.         SDL_Event event;
  14.         while(SDL_PollEvent(&event)) {
  15.             switch(event.type) {
  16.                 case SDL_QUIT:
  17.                     running = false;
  18.                     break;
  19.             }
  20.         }
  21.         //logic && render
  22.  
  23.  
  24.         SDL_Flip(screen);
  25.     }
  26.     SDL_Quit();
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement