#include <TextureManager.h>
Public Methods | |
TextureManager (std::string directory, std::string extension, GraphicsDevice device) | |
Initializes the TextureManager using the textures in the given directory and with the given extension. | |
~TextureManager () | |
Cleans up the textures by releasing all of the textures that were loaded. | |
int | numTextures () const |
Returns the number of textures in this manager, the number that were successfully loaded from manager creation. | |
Texture | getTexture (int idx) const |
Returns the texture for the specified index. |
The files in the directory need to start at number 0 and go to some number. If we call this number "x", and the even extension "ext", the file format should be:
x.ext
TextureManager loads textures in this directory incrementally starting from 0 until it encounters an error loading the next numbered texture (for example if file is not found). It then stops loading and the set of textures consists of all textures successfully loaded.
The end result is that the TextureManager contains n textures numbered from 0 to (n-1), inclusive.
|
Initializes the TextureManager using the textures in the given directory and with the given extension. See the class's main documentation for more information on this process. The directory name should NOT contain a trailing slash, and the extension should NOT contain the period. Call the numTextures method to read how many textures were loaded. The textures are loaded with the D3DXCreateTextureFromFile function, and thus have the attributes a texture loaded with that function would have. The textures are loaded onto the given device. TextureManager is not defaultly constructable -- this is the only valid constructor. |
|
Cleans up the textures by releasing all of the textures that were loaded.
|
|
Returns the texture for the specified index. Precondition: 0 <= idx < numTextures() |
|
Returns the number of textures in this manager, the number that were successfully loaded from manager creation.
|