void MSoundRef::clear(void) { MEngine * engine = MEngine::getInstance(); MSoundContext * soundContext = engine->getSoundContext(); soundContext->deleteBuffer(&m_bufferId); }
void MSoundRef::update(void) { MEngine * engine = MEngine::getInstance(); MSoundContext * soundContext = engine->getSoundContext(); // force clear clear(); MSound sound; if(engine->getSoundLoader()->loadData(getFilename(), &sound)) { // create new buffer soundContext->createBuffer(&m_bufferId); soundContext->sendBufferSound(m_bufferId, &sound); } }