#include <TextureManager.h>
Public Member Functions | |
| CTextureManager (void) | |
| ~CTextureManager (void) | |
| int | LoadTexture (const char *szFilename, int nTextureID=-1) |
| int | LoadTextureFromMemory (UBYTE *pData, int nWidth, int nHeight, int nBPP, int nTextureID=-1) |
| void | FreeTexture (int nID) |
| void | FreeAll (void) |
| char * | GetErrorMessage (void) |
| int | GetNumTextures (void) |
| int | GetAvailableSpace (void) |
| int | GetTexID (int nIndex) |
Static Public Member Functions | |
| static CTextureManager & | GetSingleton (void) |
| static void | Destroy (void) |
Private Member Functions | |
| UBYTE * | LoadBitmapFile (const char *filename, int &nWidth, int &nHeight, int &nBPP) |
| UBYTE * | LoadTargaFile (const char *filename, int &nWidth, int &nHeight, int &nBPP) |
| int | GetNewTextureID (int nPossibleTextureID) |
| bool | CheckSize (int nDimension) |
Static Private Member Functions | |
| static void | Initialize (void) |
Private Attributes | |
| char | szErrorMessage [80] |
| int | nNumTextures |
| int | nAvailable |
| int * | nTexIDs |
Static Private Attributes | |
| static CTextureManager * | m_Singleton = 0 |
Verwaltet Texturen und deren IDs
|
|
No use for a constructor because this singlton is never created, when GetSingleton is called for the first time and issued a 'new' command the constructor is called, however because of the memory isn't valid until AFTER the constructor it just is a bad idea... Use Initialize and Destroy for your dirty work |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||||||||||
|
|
|
|
Note : Being a singleton all the data we 'want' is located in CTextureManager::m_Singleton, so although it looks really ugly to have so many 'm_Singleton->'s this is so the code will actually work as designed ;) |
|
|
|
|
|
|
|
|
|
|
|
|
1.4.5