Symphony Of Empires
Eng3D::TextureManager Class Reference

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::Textureload (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::Textureload (std::shared_ptr< Eng3D::IO::Asset::Base > asset, TextureOptions options=default_options)
 
std::shared_ptr< Eng3D::Texturegen_text (Eng3D::TrueType::Font &font, Eng3D::Color color, const std::string &msg)
 
std::shared_ptr< Eng3D::Textureget_white ()
 

Friends

class Eng3D::Texture
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TextureManager() [1/2]

Eng3D::TextureManager::TextureManager ( )
delete

◆ TextureManager() [2/2]

Eng3D::TextureManager::TextureManager ( Eng3D::State _s)
inline

Definition at line 214 of file texture.hpp.

◆ ~TextureManager()

Eng3D::TextureManager::~TextureManager ( )

Definition at line 405 of file texture.cpp.

Member Function Documentation

◆ gen_text()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_white()

std::shared_ptr< Eng3D::Texture > Eng3D::TextureManager::get_white ( )

Definition at line 417 of file texture.cpp.

Here is the caller graph for this function:

◆ load() [1/2]

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load() [2/2]

std::shared_ptr< Eng3D::Texture > Eng3D::TextureManager::load ( std::shared_ptr< Eng3D::IO::Asset::Base asset,
TextureOptions  options = default_options 
)

Definition at line 454 of file texture.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ Eng3D::Texture

friend class Eng3D::Texture
friend

Definition at line 225 of file texture.hpp.


The documentation for this class was generated from the following files: