#include "App.h" #include #include App::App() : wnd( 800,600,"Oasis Demo") {} int App::Go() { while (true) { // process all messages pending, but to not block for new messages if (const auto ecode = Window::ProcessMessages()) { // if return optional has value, means we're quitting so return exit code return *ecode; } DoFrame(); // µÈ´ý10ºÁÃ룬·ÀÖ¹¼ÙËÀ Sleep(10); } } void App::DoFrame() { const float t = timer.Peek(); std::ostringstream oss; oss << "Time elapsed: " << std::setprecision(1) << std::fixed << t << "s"; wnd.SetTitle(oss.str()); }