Guest User

Untitled

a guest
May 8th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. #undef main
  2. #include <SDL/SDL.h>
  3. int main( int argc, char **argv[] )
  4. {
  5.         bool done = false;
  6.  
  7.         SDL_Surface* hello = NULL;
  8.         SDL_Surface* screen = NULL;
  9.  
  10.         SDL_Init( SDL_INIT_EVERYTHING );
  11.        
  12.         screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
  13.  
  14.         hello = SDL_LoadBMP( "hello.bmp" );
  15.  
  16.         SDL_Event event;
  17.  
  18. while(!done)
  19.                  {
  20.  
  21.                 SDL_BlitSurface( hello, NULL, screen, NULL );
  22.  
  23.                   while(SDL_PollEvent(&event))
  24.                                    {
  25.                                          switch(event.type)
  26.                                                                 {
  27.  
  28.                                                                         case SDL_QUIT:
  29.                                                                         return 0;
  30.                                                                         break;
  31.  
  32.                                                                           }
  33.  
  34.                                          }
  35.  
  36.                                 SDL_Flip( screen );
  37.  
  38.                         }
  39.           return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment