当前位置: 首页>>代码示例>>C++>>正文


C++ CAudioManager::StopSoundClip方法代码示例

本文整理汇总了C++中CAudioManager::StopSoundClip方法的典型用法代码示例。如果您正苦于以下问题:C++ CAudioManager::StopSoundClip方法的具体用法?C++ CAudioManager::StopSoundClip怎么用?C++ CAudioManager::StopSoundClip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAudioManager的用法示例。


在下文中一共展示了CAudioManager::StopSoundClip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

//********************************************************************
// main()
//********************************************************************
int main(){

  //instantiate log object and log
  CLog *pLog = CLog::Instance();
  pLog->Log("*********************************************************");
  pLog->Log("Program starting..................");
  pLog->SetDelimiter(':');
  pLog->LogDate();
  pLog->LogTime();
  pLog->Log("************************ *********************************");
   
  cout << "Enter name: ";
  cin >> g_playerName;
  //system("cls");

  //initialize console
  Console con(80, 25);//50);
  con.SetConsolePosition(0,0);
  con.CenterConsoleWindow();
  con.cls();

  Initialize();
  
  CONSOLE_SCREEN_BUFFER_INFO csbi = con.GetScreenBufferInfo();
  pLog->LogPair("Screen Buffer Size",csbi.dwSize.X, csbi.dwSize.Y);
  pLog->LogPair("Window Size",csbi.dwMaximumWindowSize.X, csbi.dwMaximumWindowSize.Y);
  pLog->LogPair("Left-Top",csbi.srWindow.Left, csbi.srWindow.Top);
  pLog->LogPair("Right-Bottom",csbi.srWindow.Right, csbi.srWindow.Bottom);
  pLog->LogPair("Maximum Window Size", csbi.dwMaximumWindowSize.X, csbi.dwMaximumWindowSize.Y);
  COORD maxSize = con.GetMaximumScreenSize();
  pLog->LogPair("Max Size",maxSize.X, maxSize.Y);

  //game timer
  CTimer loopTimer;
  CTimer renderTimer;
  loopTimer.Initialize();
  renderTimer.Initialize();
  double timeDelta = 0;

  char buffer[] = "Chuck's Factory Game";
  con.setTitle(buffer);

  //main game loop
  //********************************************
  bool quit = false;    
  while(!quit){ 
    timeDelta = loopTimer.GetTimeDifference();
    g_pNext = g_pCurrent->Update(timeDelta);
	  if(NULL != g_pNext)
	  {
      g_pCurrent = g_pNext;
    }
     
    if(g_pCurrent == g_pStateQuit )
      quit = true;

  	// Render our current game object
    //if(renderTimer.GetTimer(0.1)== true)
      g_pCurrent->Render(con);
  }
  //********************************************
  //end game loop

  //free resources
  delete g_pStateIntro;
  delete g_pStateMenu;
  delete g_pStateQuit;
  delete g_pStateRules;
  delete g_pStateScore;
  delete g_pStatePlay;

  for(int i = 0; i < 9; ++i)
    g_audio.StopSoundClip(i);

  system("cls");
  
  //normal termination of game
  pLog->Log("*********************************************************");
  pLog->Log("Program terminating normally..................");
  pLog->SetDelimiter(':');
  pLog->LogTime();
  pLog->Log("*********************************************************");
  
  return 0;
}
开发者ID:ChuckBolin,项目名称:DOS2DGame,代码行数:88,代码来源:main.cpp


注:本文中的CAudioManager::StopSoundClip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。