void TextureManager::onResetDevice() { if (!initialized) return; for(UINT i=0; i<fileNames.size(); i++) { hr = graphics->loadTexture(fileNames[i].c_str(), graphicsNS::TRANSCOLOR, width[i], height[i], texture[i]); if (FAILED(hr)) safeReleaseTexture(texture[i]); } }
void TextureManager::onLostDevice() { try { if (!initialized) return; for(UINT i=0; i<texture.size(); i++) safeReleaseTexture(texture[i]); }catch(...) { throw(GameError(gameErrorNS::WARNING, "Warning, TextureManager onLostDevice attempted to access an invalid texture.")); } }
//============================================================================= // デストラクタ //============================================================================= TextureManager::~TextureManager() { for (UINT i = 0; i<texture.size(); i++) safeReleaseTexture(texture[i]); }