dotfiles

my shiny new dotfiles
git clone git://git.jakekoroman.com/dotfiles
Log | Files | Refs | README

sdlboil (626B)


      1 # -*- mode: snippet -*-
      2 # name: sdlboil
      3 # key: sdlboil
      4 # --
      5 SDL_Init(SDL_INIT_VIDEO);
      6 
      7 SDL_Window *window = SDL_CreateWindow("SDL Boilerplate",
      8 									0, 0,
      9 									1280, 720,
     10 									SDL_WINDOW_RESIZABLE);
     11 
     12 SDL_Renderer *renderer = SDL_CreateRenderer(window, -1,
     13 											SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED);
     14 
     15 bool running = true;
     16 while (running) {
     17 	SDL_Event event = {0};
     18 	while (SDL_PollEvent(&event)) {
     19 		switch (event.type) {
     20 			case SDL_QUIT: {
     21 				running = false;
     22 			} break;
     23 		}
     24 	}
     25 	SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
     26 	SDL_RenderClear(renderer);
     27 	SDL_RenderPresent(renderer);
     28 }
     29 $0