mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 22:31:49 +01:00
Add Imgui, Add TextureManager
From 1.1k texture loads to 5
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user