本文整理汇总了C++中SoundManager::deinit方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundManager::deinit方法的具体用法?C++ SoundManager::deinit怎么用?C++ SoundManager::deinit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundManager
的用法示例。
在下文中一共展示了SoundManager::deinit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
rmanager->showShadow(false);
SpeedController scontroller(gameConfig.getFloat("gamefps"));
SpeedController::setMainInstance(&scontroller);
scontroller.setDrawFPS(gameConfig.getBool("showfps"));
smanager = SoundManager::createSoundManager();
smanager->init();
smanager->setVolume(gameConfig.getFloat("global_volume"));
smanager->setMute(gameConfig.getBool("mute"));
smanager->playSound("sounds/bums.wav", 0.0);
smanager->playSound("sounds/pfiff.wav", 0.0);
std::string bg = std::string("backgrounds/") + gameConfig.getString("background");
if (PHYSFS_exists(bg.c_str()))
rmanager->setBackground(bg);
InputManager* inputmgr = InputManager::createInputManager();
if (argc == 3)
{
if (strstr(argv[1], ".lua"))
{
gameConfig.setString("left_player_human", "false");
gameConfig.setString("left_script_name", argv[1]);
}
else
{
gameConfig.setString("left_player_human", "true");
gameConfig.setString("left_player_name", argv[1]);
}
if (strstr(argv[2], ".lua"))
{
gameConfig.setString("right_player_human", "false");
gameConfig.setString("right_script_name", argv[2]);
}
else
{
gameConfig.setString("right_player_human", "true");
gameConfig.setString("right_player_name", argv[2]);
}
gameConfig.saveFile("config.xml");
State::setCurrentState(new LocalGameState(), true);
}
int running = 1;
while (running)
{
inputmgr->updateInput();
running = inputmgr->running();
// This is true by default for compatibility, GUI states may
// disable it if necessary
rmanager->drawGame(true);
IMGUI::getSingleton().begin();
State::getCurrentState()->step();
rmanager = &RenderManager::getSingleton(); //RenderManager may change
//draw FPS:
if (scontroller.getDrawFPS())
{
// We need to ensure that the title bar is only set
// when the framerate changed, because setting the
// title can ne quite resource intensive on some
// windows manager, like for example metacity.
static int lastfps = 0;
int newfps = scontroller.getFPS();
if (newfps != lastfps)
{
std::stringstream tmp;
tmp << AppTitle << " FPS: " << newfps;
rmanager->setTitle(tmp.str());
}
lastfps = newfps;
}
if (!scontroller.doFramedrop())
{
rmanager->draw();
IMGUI::getSingleton().end();
BloodManager::getSingleton().step();
rmanager->refresh();
}
scontroller.update();
}
}
catch (std::exception& e)
{
std::cerr << e.what() << std::endl;
if (rmanager)
rmanager->deinit();
if (smanager)
smanager->deinit();
SDL_Quit();
PHYSFS_deinit();
exit (EXIT_FAILURE);
}
deinit();
exit(EXIT_SUCCESS);
}