12345678910111213141516171819202122232425262728293031323334353637 |
- /*
- * 2D Game Engine
- * AssetStore.h:
- * Based on pikuma.com 2D game engine in C++ and Lua course
- * Copyright (c) 2021 986-Studio. All rights reserved.
- *
- * Created by Manoël Trapier on 12/02/2021.
- */
- #ifndef GAMEENGINE_ASSETSTORE_H
- #define GAMEENGINE_ASSETSTORE_H
- #include <SDL.h>
- #include <SDL_ttf.h>
- #include <string>
- #include <map>
- class AssetStore
- {
- private:
- std::map<std::string, SDL_Texture *> textures;
- std::map<std::string, TTF_Font *> fonts;
- // Sounds
- public:
- AssetStore() = default;
- ~AssetStore() = default;
- void clearStore();
- void addTexture(SDL_Renderer *renderer, const std::string &assetId, const std::string &filePath);
- SDL_Texture *getTexture(const std::string &assetId);
- void addFont(const std::string &assetId, const std::string &filePath, uint32_t fontSize);
- TTF_Font *getFont(const std::string &assetId);
- };
- #endif /* GAMEENGINE_ASSETSTORE_H */
|