void TUI::OnFrame() { EDevice.FrameMove (); SndLib->OnFrame (); // tools on frame if (m_Flags.is(flUpdateScene)) RealUpdateScene(); Tools->OnFrame (); // show hint ShowObjectHint (); ResetBreak (); // check mail CheckMailslot (); // OnFrame TfrmImageLib::OnFrame(); TfrmSoundLib::OnFrame(); TfrmChoseItem::OnFrame(); // Progress ProgressDraw (); }
bool cGame::Loop() { int t1, t2; t1 = glutGet(GLUT_ELAPSED_TIME); if (bIsFirst) {//only call once for init on active_scene bIsFirst = false; active_scene->Init(); } Update(); Render(); if (bSceneValid == false) { RealUpdateScene(); } do { t2 = glutGet(GLUT_ELAPSED_TIME); } while (t2 - t1 < 1000 / 30); //30 fps = 1000/30 return true; }