210 {
211 if (stdscr == nullptr || current_render_obj_ == nullptr) {
212 return;
213 }
214
215 highlight_direction_ = 0;
216
217 void (
Screen::*showFuncs[])(int) = {&Screen::ShowRenderMessage,
218 &Screen::ShowInteractiveCmd};
219
220 do {
221 int ch = getch();
222
223 if (ch == 'q' || ch == 'Q' || ch == 27) {
224 canRun_ = false;
225 break;
226 }
227
228 ch = SwitchState(ch);
229
230 (this->*showFuncs[static_cast<int>(current_state_)])(ch);
231
233 if (fr < MinHalfFrameRatio) {
234 fr = MinHalfFrameRatio;
235 }
236 int period = static_cast<int>(1000.0 / fr);
237 period >>= 1;
238 std::this_thread::sleep_for(std::chrono::milliseconds(period));
239 } while (canRun_);
240}
virtual double frame_ratio(void)