Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SDL.h>
- int main(int argc, char *argv[])
- {
- //inicjalizacja podstawowa (całość biblioteki: grafika, audio, obsługa myszy, klawiatury, timer itd)
- SDL_Init( SDL_INIT_EVERYTHING );
- //okno o rozdzielczości 800 x 600
- SDL_Window * ekran = SDL_CreateWindow("nazwa_okna",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,800,600,0);
- //renderer z synchronizacją pionową
- SDL_Renderer *renderer = SDL_CreateRenderer(ekran,-1,SDL_RENDERER_PRESENTVSYNC);
- /*
- //obsługa zdarzeń
- SDL_Event kolejka;
- //przechowywanie stanu klawiszy
- const Uint8 * keystate = SDL_GetKeyboardState( NULL );
- */
- while(1)
- {
- //główna pętla programu - niekończące się "rysowanie"
- SDL_RenderClear(renderer);
- SDL_SetRenderDrawColor(renderer, 200, 200, 200, 255);
- SDL_RenderPresent(renderer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement