Loading...
Searching...
No Matches
TextureManager.cpp
Go to the documentation of this file.
1
//
2
// Created by denzel on 03/04/2025.
3
//
4
5
#
include
"hellfire/graphics/managers/TextureManager.h"
6
7
// Singleton class instance
8
hellfire
::
TextureManager
&
hellfire
::
TextureManager
::
get_instance
() {
9
if
(!
instance_
) {
10
instance_
=
new
TextureManager
(
)
;
11
}
12
return
*
instance_
;
13
}
14
15
hellfire
::
Texture
*
hellfire
::
TextureManager
::
get_texture
(
const
std::string &path) {
16
auto
it = textures_.find(path);
17
if
(it != textures_.end()) {
18
return
it->second;
19
}
20
return
nullptr
;
21
}
22
23
void
hellfire
::
TextureManager
::
clear
() {
24
for
(
auto
&pair: textures_) {
25
delete
pair.second;
26
}
27
textures_.clear();
28
}
29
30
hellfire
::
TextureManager
*
hellfire
::
TextureManager
::
instance_
=
nullptr
;
hellfire::TextureManager
Definition
TextureManager.h:13
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::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.cpp
Generated by
1.9.8