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
9 if (!instance_) {
11 }
12 return *instance_;
13}
14
15hellfire::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
24 for (auto &pair: textures_) {
25 delete pair.second;
26 }
27 textures_.clear();
28}
29
static TextureManager & get_instance()
static TextureManager * instance_
Texture * get_texture(const std::string &path)