Guest User

Untitled

a guest
Mar 13th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. //============================================================================
  2. // Name        : App1.cpp
  3. // Author      :
  4. // Version     :
  5. // Copyright   : Your copyright notice
  6. //============================================================================
  7.  
  8. #include<stdio.h>
  9. #include <SDL/SDL.h>
  10.  
  11. int main(int argc, char **argv) {
  12.  
  13.     SDL_Init(SDL_INIT_EVERYTHING);
  14.     SDL_Event event;
  15.     SDL_bool EXIT_STATUS = SDL_FALSE;
  16.  
  17.     /* window 320X240, 32bits of color*/
  18.     SDL_Surface *screen = SDL_SetVideoMode(320, 240, 32, 0);
  19.  
  20.     /*MainLoop*/
  21.     while (!EXIT_STATUS) {
  22.         /* Event loop*/
  23.         while (SDL_PollEvent(&event)) {
  24.             if (event.type == SDL_QUIT) {
  25.                 EXIT_STATUS = SDL_TRUE;
  26.             }
  27.         }
  28.         /*update*/
  29.         SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,200,100,0));
  30.         /*Draw*/
  31.         SDL_Flip(screen);
  32.         SDL_Delay(10);
  33.     }
  34.     printf("Hola");
  35.     SDL_Quit();
  36.     return 0;
  37. }
Add Comment
Please, Sign In to add comment