text: /*
  ** File name :
  ** sdl.c
  ** File creator :
  ** Mathilde
  */
  
  #include "taquin.h"
  
  uint8_t loadImage(SDL_Surface *surface, char const *path)
  {
      surface = SDL_LoadBMP(path);
      if (surface == NULL)
      {
          return EXIT_FAILURE;
      }
      return EXIT_SUCCESS;
  }
  
  uint8_t loadImageToTexture(SDL_Renderer *renderer, SDL_Texture *texture, char const *path)
  {
      SDL_Surface *surface = SDL_LoadBMP(path);
  
      if (surface == NULL)
      {
          return EXIT_FAILURE;
      }
      texture = SDL_CreateTextureFromSurface(renderer, surface);
      if (texture == NULL)
      {
          return EXIT_FAILURE;
      }
      return EXIT_SUCCESS;
  }
  
  uint8_t loadImageToImageStruct(SDL_Renderer *renderer, image_t *image, char const *path)
  {
      image->surface_ = SDL_LoadBMP(path);
      if (image->surface_ == NULL)
      {
          return EXIT_FAILURE;
      }
      image->texture_ = SDL_CreateTextureFromSurface(renderer, image->surface_);
      if (image->texture_ == NULL)
      {
          return EXIT_FAILURE;
      }
      return EXIT_SUCCESS;
  }
  
  uint8_t loadImageToButtonStruct(SDL_Renderer *render, button_t *button, char const *path)
  {
      button->surface_ = SDL_LoadBMP(path);
      if (button->surface_ == NULL)
      {
          return EXIT_FAILURE;
      }
      button->texture_ = SDL_CreateTextureFromSurface(render, button->surface_);
      if (button->texture_ == NULL)
      {
          return EXIT_FAILURE;
      }
      return EXIT_SUCCESS;
  }