Пример #1
0
void MSoundRef::clear(void)
{
    MEngine * engine = MEngine::getInstance();
    MSoundContext * soundContext = engine->getSoundContext();

    soundContext->deleteBuffer(&m_bufferId);
}
Пример #2
0
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);
    }
}