123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
-
-
- #ifndef _TEXTURE_MANAGER_H
- #define _TEXTURE_MANAGER_H
-
- #include <vector>
-
-
- class TextureManager {
- public:
-
- enum TextureFlag {
- fUseMultiTexture = (1 << 0),
- };
-
-
-
- TextureManager();
-
-
-
- ~TextureManager();
-
-
-
- void reset();
-
- int initialize();
-
-
-
- int getTextureCount();
-
-
-
- void bindMultiTexture(int texture0, int texture1);
-
-
-
- void bindTextureId(unsigned int n);
-
-
-
- void clearFlag(TextureFlag flag);
-
- void disableMultiTexture();
-
-
-
- int loadBufferSlot(unsigned char *image,
- unsigned int width, unsigned int height,
- ColorMode mode, unsigned int bpp,
- unsigned int slot);
-
- int loadImage(const char *filename);
-
-
-
- void setFlag(TextureFlag flag);
-
- void useMultiTexture(float aU, float aV, float bU, float bV);
-
- private:
- int loadTGA(const char *filename);
- int loadPCX(const char *filename);
- int loadPNG(const char *filename);
-
- std::vector<unsigned int> mTextureIds;
- unsigned int mFlags;
- };
-
- TextureManager &getTextureManager();
-
- #endif
|