Loading...
Searching...
No Matches
TextureManager.h
Go to the documentation of this file.
1
//
2
// Created by denzel on 03/04/2025.
3
//
4
5
#
ifndef
TEXTUREMANAGER_H
6
#
define
TEXTUREMANAGER_H
7
#
include
<
string
>
8
#
include
<
unordered_map
>
9
10
#
include
"hellfire/graphics/texture/Texture.h"
11
12
namespace
hellfire
{
13
class
TextureManager
{
14
public
:
15
static
TextureManager
&
get_instance
();
16
17
Texture
*
get_texture
(
const
std::string &path);
18
19
void
add_texture
(
const
std::string &path,
Texture
*texture) { textures_[path] = texture; }
20
21
void
clear
();
22
23
~
TextureManager
() {
24
clear
(
)
;
25
}
26
27
private
:
28
static
TextureManager
*
instance_
;
29
30
TextureManager
() {
31
}
32
33
std
::
unordered_map
<
std
::
string
,
Texture
*>
textures_
;
34
};
35
36
}
37
38
39
#
endif
//TEXTUREMANAGER_H
hellfire::TextureManager
Definition
TextureManager.h:13
hellfire::TextureManager::add_texture
void add_texture(const std::string &path, Texture *texture)
Definition
TextureManager.h:19
hellfire::TextureManager::get_instance
static TextureManager & get_instance()
Definition
TextureManager.cpp:8
hellfire::TextureManager::instance_
static TextureManager * instance_
Definition
TextureManager.h:28
hellfire::TextureManager::clear
void clear()
Definition
TextureManager.cpp:23
hellfire::TextureManager::TextureManager
TextureManager()
Definition
TextureManager.h:30
hellfire::TextureManager::textures_
std::unordered_map< std::string, Texture * > textures_
Definition
TextureManager.h:33
hellfire::TextureManager::~TextureManager
~TextureManager()
Definition
TextureManager.h:23
hellfire::TextureManager::get_texture
Texture * get_texture(const std::string &path)
Definition
TextureManager.cpp:15
hellfire::Texture
Definition
Texture.h:91
hellfire
Definition
AssetManager.cpp:10
engine
src
hellfire
graphics
managers
TextureManager.h
Generated by
1.9.8