Add Imgui, Add TextureManager

From 1.1k texture loads to 5
This commit is contained in:
Bram Verhulst
2024-03-18 12:22:56 +01:00
parent 05f46b7eba
commit 39c744ba79
33 changed files with 59230 additions and 378 deletions

View File

@@ -1,2 +1,20 @@
#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;
}