void afficher_menu(SDL_Window ** window, SDL_Renderer ** renderer)
{

    * window = SDL_CreateWindow("The badass penguin",
    SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1100, 700, 0);
    * renderer = SDL_CreateRenderer(*window, -1, 0);
    SDL_Surface * image = SDL_LoadBMP("images/menu_jeu.bmp");
	SDL_Texture * texture = SDL_CreateTextureFromSurface(*renderer, image);
    SDL_Rect dstrect = { 0, 0, 1100, 700 };
    SDL_RenderCopy(*renderer, texture, NULL, &dstrect);
    SDL_RenderPresent(*renderer);
}

void afficher_credits(SDL_Window ** window, SDL_Renderer ** renderer)
{
    SDL_Surface * image = SDL_LoadBMP("images/credits.bmp");
	SDL_Texture * texture = SDL_CreateTextureFromSurface(*renderer, image);
    SDL_Rect dstrect = { 0, 0, 1100, 700 };
    SDL_RenderCopy(*renderer, texture, NULL, &dstrect);
    SDL_RenderPresent(*renderer);
}

void afficher_case(int *tab[200], SDL_Window ** window, SDL_Renderer ** renderer)
{
    int i = 0;
    int x = 0;
    int y = 0;

    for (i=0; i<200; i++)
    {
        if(tab[i]=='0')
        {
            SDL_Surface * image = SDL_LoadBMP("images/vide.bmp");
            SDL_Texture * texture = SDL_CreateTextureFromSurface(*renderer, image);
            SDL_Rect dstrect = { x, y, 100, 100 };
            SDL_RenderCopy(*renderer, texture, NULL, &dstrect);
            SDL_RenderPresent(*renderer);
            SDL_RenderClear(&renderer);
            SDL_DestroyRenderer(&renderer);

            x = x+100;
        }

        if(tab[i]=='1')
        {
            SDL_Surface * image = SDL_LoadBMP("images/brique.bmp");
            SDL_Texture * texture = SDL_CreateTextureFromSurface(*renderer, image);
            SDL_Rect dstrect = { x, y, 100, 100 };
            SDL_RenderCopy(*renderer, texture, NULL, &dstrect);
            SDL_RenderPresent(*renderer);
            SDL_RenderClear(&renderer);
            SDL_DestroyRenderer(&renderer);

            x = x+100;
        }

         if(x>=1100)
            {
                y=y+100;
                x=0;
            }

         if (x==1100 && y==700)
         {
             i=200;
         }

    }
}

void  afficher_pingouin(SDL_Window ** window, SDL_Renderer ** renderer, int *px, int *py)
{
    SDL_Renderer * rendererp = SDL_CreateRenderer(*window, -1, 0);
    SDL_Surface * pingouin = SDL_LoadBMP("images/pingouin1.bmp");
    SDL_Texture * texturep = SDL_CreateTextureFromSurface(*renderer, pingouin);
    SDL_Rect dstrectp = { *px, *py, 100, 100 };
    SDL_RenderCopy(*renderer, texturep, NULL, &dstrectp);
    SDL_RenderPresent(*renderer);
}

void afficher_sceau(SDL_Window ** window, SDL_Renderer ** renderer, int *pxs, int *pys)
{
    SDL_Renderer * renderers = SDL_CreateRenderer(*window, -1, 0);
    SDL_Surface * sceau = SDL_LoadBMP("images/sceau_poisson1.bmp");
    SDL_Texture * textures = SDL_CreateTextureFromSurface(*renderer, sceau);
    SDL_Rect dstrects = { *pxs, *pys, 100, 100 };
    SDL_RenderCopy(*renderer, textures, NULL, &dstrects);
    SDL_RenderPresent(*renderer);
}
