Skip to content
Snippets Groups Projects
sdl2.h 660 B
Newer Older
Arnaud Albiez's avatar
Arnaud Albiez committed
#pragma once
#include <SDL2/SDL.h>
#include "grid.h"
Arnaud Albiez's avatar
Arnaud Albiez committed
typedef struct SDLContext {
  SDL_Window *window;
  SDL_Renderer *renderer;
  int width;
  int height;
} SDLContext;
Arnaud Albiez's avatar
Arnaud Albiez committed
/* @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();
Arnaud Albiez's avatar
Arnaud Albiez committed
/**
 * 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();