#include "../../include/raylib-cpp.hpp"
#include <vector>
#include "textures.hpp"
using namespace std;

typedef int ID;

TextureAtlas::TextureAtlas (){
  atlas.clear();
}
  
Texture TextureAtlas::GetTexture(ID id) {
  if (atlas.size() >= id) {
    return atlas[0];
  }
  return atlas[id];
}

void TextureAtlas::LoadImage(const char *path) {
  atlas.push_back(LoadTexture(path));
}

void TextureAtlas::AddTexture(Texture texture){
  atlas.push_back(texture);
}

Texture defaultTexture;
TextureAtlas entityTextures;

void GenDefaultTexture(){
  Image img = GenImageChecked(64, 64, 16, 16, PURPLE, BLACK);
  defaultTexture = LoadTextureFromImage(img);
  UnloadImage(img);
}

