37 lines
1.1 KiB
C
37 lines
1.1 KiB
C
#include "algorithm.c"
|
|
|
|
// gcc -g -Wall -Wextra -Wpedantic main.c -lSDL2 -lSDL2_image -lm -o main
|
|
|
|
int main() {
|
|
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
|
|
printf("error initializing SDL: %s\n", SDL_GetError());
|
|
}
|
|
SDL_Window* win = SDL_CreateWindow("a game", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, 0);
|
|
|
|
Uint32 render_flags = SDL_RENDERER_ACCELERATED;
|
|
SDL_Renderer* rend = SDL_CreateRenderer(win, -1, render_flags);
|
|
SDL_SetRenderDrawBlendMode(rend, SDL_BLENDMODE_BLEND);
|
|
|
|
creneau* edt = import_creneaux("file.txt", 112);
|
|
int len_creneau = 112;
|
|
|
|
//printf("%d %d %d %d\n", edt[10].date.hour, edt[10].date.day, edt[10].date.month, edt[10].date.year);
|
|
|
|
date d1 = {17, 1, 3, 2024};
|
|
//printf("%d %d %d %d\n", edt[70].date.hour, edt[70].date.day, edt[70].date.month, edt[70].date.year);
|
|
|
|
print_one_week(rend, edt, 112, d1);
|
|
|
|
/*
|
|
date d1 = {19, 1, 3, 2024};
|
|
date d2 = {18, 1, 4, 2024};
|
|
|
|
printf("%d\n", date_dist(d1, d2));
|
|
*/
|
|
|
|
SDL_DestroyRenderer(rend);
|
|
SDL_DestroyWindow(win);
|
|
SDL_Quit();
|
|
return 0;
|
|
}
|