1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
-
-
- #ifndef _TEXTURE_MANAGER_H
- #define _TEXTURE_MANAGER_H
-
- #include <vector>
-
-
- #define TEXTURE_WHITE 0
- #define TEXTURE_SPLASH 1
-
-
- class TextureManager {
- public:
-
- enum class TextureStorage {
- GAME,
- SYSTEM
- };
-
- ~TextureManager();
-
- int initialize();
-
-
-
- void bindTextureId(unsigned int n, TextureStorage s = TextureStorage::GAME);
-
-
-
- int loadBufferSlot(unsigned char* image,
- unsigned int width, unsigned int height,
- ColorMode mode, unsigned int bpp,
- TextureStorage s = TextureStorage::GAME,
- int slot = -1, bool filter = true);
-
- int loadImage(const char* filename, TextureStorage s = TextureStorage::GAME, int slot = -1);
-
- private:
- std::vector<unsigned int>& getIds(TextureStorage s);
-
- int loadTGA(const char* filename, TextureStorage s, int slot);
- int loadPCX(const char* filename, TextureStorage s, int slot);
- int loadPNG(const char* filename, TextureStorage s, int slot);
-
- std::vector<unsigned int> mTextureIdsGame;
- std::vector<unsigned int> mTextureIdsSystem;
- };
-
- TextureManager& getTextureManager();
-
- #endif
|