void gameShutdown() { if (g_inited) { gameGlShutdown(); // TODO call this when context still active // game objects delete g_ground; g_ground = NULL; delete g_ship; g_ship = NULL; for (int i = 0; i < kNumCubes; ++i) { delete g_cubes[i]; g_cubes[i] = NULL; } // sound g_music->destroy(); g_pointSound->destroy(); g_engineSound->destroy(); g_bank->destroy(); CkShutdown(); g_inited = false; } }
//! Destructor AudioDriver::~AudioDriver() { if(m_pMusicMixer) { m_pMusicMixer->destroy(); m_pMusicMixer = NULL; } if(m_pSoundMixer) { m_pSoundMixer->destroy(); m_pSoundMixer = NULL; } CkUpdate(); CkShutdown(); }
void Java_com_crickettechnology_samples_HelloCricketNDK_MainActivity_helloCricketNative(JNIEnv* env, jobject activity) { CkConfig config(env, activity); CkInit(&config); CkBank* bank = CkBank::newBank("hellocricket.ckb"); CkSound* sound = CkSound::newBankSound(bank, 0); sound->play(); while (sound->isPlaying()) { CkUpdate(); usleep(30000); } sound->destroy(); bank->destroy(); CkShutdown(); }
int main(int argc, char* argv[]) { CkConfig config; CkInit(&config); CkBank* bank = CkBank::newBank("hellocricket.ckb"); CkSound* sound = CkSound::newBankSound(bank, 0); sound->play(); while (sound->isPlaying()) { CkUpdate(); Sleep(30); } sound->destroy(); bank->destroy(); CkShutdown(); return 0; }
void SoundSystem::ShutDown() { CkShutdown(); delete this; }
//------------------------------------------------------------------------------ // The Cricket Audio system is shutdown in the destructor rather then OnDestroy // becuase the resource cleanup phase is immediately after OnDestroy. If // showdown occurs before this, any remaining CkBank resources will not be // destroyed correctly. //------------------------------------------------------------------------------ CricketAudioSystem::~CricketAudioSystem() { CkShutdown(); }