Symphony Of Empires
|
General manager for textures, caches textures into the memory instead of reading them off the disk every time they need to be accessed. More...
#include <texture.hpp>
Public Member Functions | |
TextureManager ()=delete | |
TextureManager (Eng3D::State &_s) | |
~TextureManager () | |
std::shared_ptr< Eng3D::Texture > | load (const std::string &path, TextureOptions options=default_options) |
Finds a texture in the list of a texture manager if the texture is already in the list we load the saved texture from the list instead of loading it from the disk. Otherwise we load it from the disk and add it to the saved texture list. The object returned is a pointer and we will not give ownership of textures in the list and program should not modify the contents of it since it will differ from the texture on the disk, and our main point is to mirror loaded textures from the disk - not modify them. More... | |
std::shared_ptr< Eng3D::Texture > | load (std::shared_ptr< Eng3D::IO::Asset::Base > asset, TextureOptions options=default_options) |
std::shared_ptr< Eng3D::Texture > | gen_text (Eng3D::TrueType::Font &font, Eng3D::Color color, const std::string &msg) |
std::shared_ptr< Eng3D::Texture > | get_white () |
Friends | |
class | Eng3D::Texture |
General manager for textures, caches textures into the memory instead of reading them off the disk every time they need to be accessed.
Definition at line 202 of file texture.hpp.
|
delete |
|
inline |
Definition at line 214 of file texture.hpp.
Eng3D::TextureManager::~TextureManager | ( | ) |
Definition at line 405 of file texture.cpp.
std::shared_ptr< Eng3D::Texture > Eng3D::TextureManager::gen_text | ( | Eng3D::TrueType::Font & | font, |
Eng3D::Color | color, | ||
const std::string & | msg | ||
) |
Definition at line 458 of file texture.cpp.
std::shared_ptr< Eng3D::Texture > Eng3D::TextureManager::get_white | ( | ) |
std::shared_ptr< Eng3D::Texture > Eng3D::TextureManager::load | ( | const std::string & | path, |
TextureOptions | options = default_options |
||
) |
Finds a texture in the list of a texture manager if the texture is already in the list we load the saved texture from the list instead of loading it from the disk. Otherwise we load it from the disk and add it to the saved texture list. The object returned is a pointer and we will not give ownership of textures in the list and program should not modify the contents of it since it will differ from the texture on the disk, and our main point is to mirror loaded textures from the disk - not modify them.
Definition at line 432 of file texture.cpp.
std::shared_ptr< Eng3D::Texture > Eng3D::TextureManager::load | ( | std::shared_ptr< Eng3D::IO::Asset::Base > | asset, |
TextureOptions | options = default_options |
||
) |
|
friend |
Definition at line 225 of file texture.hpp.