Chronos 0.0
A advanced 2D rendering and animation system
|
This is the texture manager for Chronos. It handles creation, modification, updating and desrtuction of textures. More...
#include <textureManager.hpp>
Public Member Functions | |
void | init (Chronos::Engine::Device *device, VkCommandPool commandPool) |
Initializes the texture manager. | |
int | addTexture (std::string texturePath, std::string textureName) |
Adds a texture to the texture manager. | |
void | removeTexture (int textureNo) |
Removes a texture from the texture manager. | |
Chronos::Engine::Texture | getTexture (int textureNo) |
Gets the texture from the texture manager. | |
void | destroy () |
Destroys the texture manager. | |
Public Attributes | |
std::map< int, Chronos::Engine::Texture > | textures |
The textures that are managed by this class. They are mapped via texture nos. | |
int | nextFreeTextureNo = 0 |
Private Attributes | |
Chronos::Engine::Device * | device |
VkCommandPool | commandPool |
This is the texture manager for Chronos. It handles creation, modification, updating and desrtuction of textures.
Once created, they can be removed or referenced by their texture number.
Definition at line 41 of file textureManager.hpp.
int Chronos::Engine::TextureManager::addTexture | ( | std::string | texturePath, |
std::string | textureName | ||
) |
Adds a texture to the texture manager.
texturePath | The path to the texture(only jpg or png). |
textureName | The name of the texture(must be unique). |
Definition at line 32 of file textureManager.cpp.
void Chronos::Engine::TextureManager::destroy | ( | ) |
Destroys the texture manager.
Definition at line 46 of file textureManager.cpp.
Chronos::Engine::Texture Chronos::Engine::TextureManager::getTexture | ( | int | textureNo | ) |
Gets the texture from the texture manager.
textureNo | The textureNo of the texture to get. |
Definition at line 53 of file textureManager.cpp.
void Chronos::Engine::TextureManager::init | ( | Chronos::Engine::Device * | device, |
VkCommandPool | commandPool | ||
) |
Initializes the texture manager.
device | The device that has the textures. |
commandPool | The command pool to create the temporary command buffer from. |
Definition at line 25 of file textureManager.cpp.
References commandPool, and device.
void Chronos::Engine::TextureManager::removeTexture | ( | int | textureNo | ) |
Removes a texture from the texture manager.
textureNo | The textureNo of the texture to remove. |
Definition at line 40 of file textureManager.cpp.
References Chronos::Engine::Device::destroy().
|
private |
Definition at line 92 of file textureManager.hpp.
|
private |
Definition at line 91 of file textureManager.hpp.
int Chronos::Engine::TextureManager::nextFreeTextureNo = 0 |
Definition at line 48 of file textureManager.hpp.
std::map<int, Chronos::Engine::Texture> Chronos::Engine::TextureManager::textures |
The textures that are managed by this class. They are mapped via texture nos.
Definition at line 47 of file textureManager.hpp.