#pragma once
#include <SDL2/SDL.h>
#include "grid.h"

typedef struct SDLContext {
  SDL_Window *window;
  SDL_Renderer *renderer;
  int width;
  int height;
} SDLContext;

/* @brief 
 * Initialise une variable global `context` de type SDLContext
 *
 * Si il y a erreur pendant l'intialisation:
 *  context.window = NULL
 *  ou 
 *  context.renderer = NULL
 *
 * Les deux cas sont à testé !
 * 
 */
void sdl_init();

/**
 * nettoie la variable global context 
 */
void sdl_quit();

/**
 * Calcule la taille d'un block par rapport a la taille de la fenetrre 
 */
int size_block(struct Grid * grid);


/**
 * gestion de l'affichage du tableau 
 */
void draw();