Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.81 KB | None | 0 0
  1. #include <SDL.h>
  2. int main(int argc, char *argv[])
  3. {  
  4.     //inicjalizacja podstawowa (całość biblioteki: grafika, audio, obsługa myszy, klawiatury, timer itd)
  5.     SDL_Init( SDL_INIT_EVERYTHING );
  6.  
  7.     //okno o rozdzielczości 800 x 600
  8.     SDL_Window * ekran = SDL_CreateWindow("nazwa_okna",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,800,600,0);
  9.  
  10.     //renderer z synchronizacją pionową
  11.     SDL_Renderer *renderer = SDL_CreateRenderer(ekran,-1,SDL_RENDERER_PRESENTVSYNC);
  12.  
  13. /*
  14.     //obsługa zdarzeń
  15.     SDL_Event kolejka;
  16.  
  17.     //przechowywanie stanu klawiszy
  18.     const Uint8 * keystate = SDL_GetKeyboardState( NULL );
  19. */
  20.  
  21.     while(1)
  22.     {
  23.         //główna pętla programu - niekończące się "rysowanie"
  24.  
  25.         SDL_RenderClear(renderer);
  26.         SDL_SetRenderDrawColor(renderer, 200, 200, 200, 255);
  27.         SDL_RenderPresent(renderer);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement