AssetStore.h 720 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * 2D Game Engine
  3. * AssetStore.h:
  4. * Based on pikuma.com 2D game engine in C++ and Lua course
  5. * Copyright (c) 2021 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 12/02/2021.
  8. */
  9. #ifndef GAMEENGINE_ASSETSTORE_H
  10. #define GAMEENGINE_ASSETSTORE_H
  11. #include <SDL.h>
  12. #include <string>
  13. #include <map>
  14. class AssetStore
  15. {
  16. private:
  17. std::map<std::string, SDL_Texture *> textures;
  18. // Fonts
  19. // Sounds
  20. public:
  21. AssetStore() = default;
  22. ~AssetStore() = default;
  23. void clearStore();
  24. void addTexture(SDL_Renderer *renderer, const std::string &assetId, const std::string &filePath);
  25. SDL_Texture *getTexture(const std::string &assetId);
  26. };
  27. #endif /* GAMEENGINE_ASSETSTORE_H */