while(device->run())
{
currentTime = timeGetTime();
pastTime = (currentTime - lastTime) * 3 + errorTime;
if(pastTime >= frameBase)
{
lastTime = currentTime;
errorTime = pastTime % frameBase;
//以下が描画処理のメイン
driver->beginScene(true,true,0xFF6060FF);
//シーンの描画
smgr->drawAll();
driver->endScene();
}
else Sleep(1);
//FPS取得/表示
fps = driver->getFPS();
if(lastFPS != fps)
{
swprintf(tmp, 32, L"Irrlicht fps:%d", fps);
device->setWindowCaption(tmp);
lastFPS = fps;
}
}
|