Initial import of KREngine

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%404
This commit is contained in:
kearwood
2011-10-25 05:03:10 +00:00
parent 5937288f78
commit cece608881
86 changed files with 12190 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
//
// KRModelManager.cpp
// gldemo
//
// Created by Kearwood Gilbert on 10-12-31.
// Copyright 2010 Kearwood Software. All rights reserved.
//
#include "KRModelManager.h"
KRModelManager::KRModelManager(KRMaterialManager *pMaterialManager) {
m_pMaterialManager = pMaterialManager;
}
KRModelManager::~KRModelManager() {
for(map<std::string, KRModel *>::iterator itr = m_models.begin(); itr != m_models.end(); ++itr){
delete (*itr).second;
}
m_models.empty();
}
KRModel *KRModelManager::loadModel(const char *szName, const char *szPath) {
KRModel *pModel = new KRModel(szPath, m_pMaterialManager);
m_models[szName] = pModel;
return pModel;
}
KRModel *KRModelManager::getModel(const char *szName) {
return m_models[szName];
}
KRModel *KRModelManager::getFirstModel() {
static std::map<std::string, KRModel *>::iterator model_itr = m_models.begin();
return (*model_itr).second;
}