Reformat + Basic animation system

General fixes
This commit is contained in:
Bram Verhulst
2024-04-01 10:27:37 +02:00
parent 3b9c96ea8d
commit 0f9bb76973
28 changed files with 918 additions and 546 deletions

View File

@@ -1,18 +1,21 @@
#include "pch.h"
#include "TextureManager.h"
TextureManager* TextureManager::m_pInstance = NULL;
TextureManager* TextureManager::m_pInstance = nullptr;
TextureManager* TextureManager::GetInstance() {
TextureManager * TextureManager::GetInstance() {
if (m_pInstance == nullptr) {
m_pInstance = new TextureManager();
}
return m_pInstance;
}
Texture* TextureManager::GetTexture(const std::string& name) {
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;
}
}
TextureManager::~TextureManager() {
//TODO: Loop over the m_Textures to delete them
}