Added KRSamplerManager::destroy()
This commit is contained in:
@@ -149,6 +149,9 @@ KRContext::~KRContext()
|
||||
m_pTextureManager->destroy();
|
||||
m_pTextureManager.reset();
|
||||
m_pPipelineManager.reset();
|
||||
if (m_pSamplerManager) {
|
||||
m_pSamplerManager->destroy();
|
||||
}
|
||||
m_pSamplerManager.reset();
|
||||
m_pAnimationManager.reset();
|
||||
m_pAnimationCurveManager.reset();
|
||||
|
||||
@@ -50,6 +50,15 @@ KRSamplerManager::KRSamplerManager(KRContext& context)
|
||||
|
||||
KRSamplerManager::~KRSamplerManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void KRSamplerManager::destroy()
|
||||
{
|
||||
for (SamplerMap::iterator itr = m_samplers.begin(); itr != m_samplers.end(); ++itr) {
|
||||
delete (*itr).second;
|
||||
}
|
||||
m_samplers.clear();
|
||||
}
|
||||
|
||||
KRSampler* KRSamplerManager::getSampler(const SamplerInfo& info)
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
virtual ~KRSamplerManager();
|
||||
|
||||
KRSampler* getSampler(const SamplerInfo& info);
|
||||
void destroy();
|
||||
private:
|
||||
typedef std::unordered_map<SamplerInfo, KRSampler*, SamplerInfoHasher> SamplerMap;
|
||||
SamplerMap m_samplers;
|
||||
|
||||
Reference in New Issue
Block a user