Files
dae16-VerhulstBram-GameProject/Game/TextureManager.cpp
2024-03-28 18:53:36 +01:00

18 lines
477 B
C++

#include "pch.h"
#include "TextureManager.h"
TextureManager* TextureManager::m_pInstance = NULL;
TextureManager* TextureManager::GetInstance() {
if (m_pInstance == nullptr) {
m_pInstance = new TextureManager();
}
return m_pInstance;
}
Texture* TextureManager::GetTexture(const std::string& name) {
if (m_Textures.find(name) != m_Textures.end()) {
return m_Textures[name];
}
Texture* pTexture = new Texture(name);
m_Textures[name] = pTexture;
return pTexture;
}