#include "../../include/raylib-cpp.hpp"
#include <string>
#include <vector>

using namespace std;

typedef int ID;

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

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

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

};

Texture defaultTexture;

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

TextureAtlas NewTextureAtlas() {
  TextureAtlas atlas;
  atlas.AddTexture(defaultTexture);
  return atlas;
}


