Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.22 KB | None | 0 0
  1. #include <stdio.h>                                                                                                                                                                          
  2.   2 #include <stdlib.h>
  3.   3 #include <SDL2/SDL.h>
  4.   4 #include "draw.h"
  5.   5
  6.   6
  7.   7 int main()
  8.   8 {
  9.   9     int continuer = 1;
  10.  10     SDL_Window *ecran = NULL;
  11.  11     SDL_Renderer *rendeur = NULL;
  12.  12     SDL_Event event;
  13.  13
  14.  14     CreateEnv(ecran, rendeur);
  15.  15    
  16.  16     rendeur = SDL_CreateRenderer(ecran, -1, SDL_RENDERER_PRESENTVSYNC);
  17.  17     if(rendeur == NULL)
  18.  18     {
  19.  19         ErrLog("CreateRenderer");
  20.  20     }
  21.  21
  22.  22     while(continuer)
  23.  23     {
  24.  24         SDL_WaitEvent(&event);
  25.  25         switch(event.type)
  26.  26         {
  27.  27             case SDL_QUIT:
  28.  28                 continuer = 0;
  29.  29                 break;
  30.  30             case SDL_KEYDOWN:
  31.  31                 switch(event.key.keysym.sym)
  32.  32                 {
  33.  33                     case SDLK_ESCAPE:
  34.  34                         continuer = 0;
  35.  35                         break;
  36.  36                 }
  37.  37         }
  38.  38
  39.  39         DrawToRender(rendeur);
  40.  40     }
  41.  41
  42.  42     CleanQuit();
  43.  43     return EXIT_SUCCESS;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement