MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ui_DoFrame

Function ui_DoFrame

ui/UISystem.cpp:493–517  ·  view source on GitHub ↗

ui_DoFrame polls input does a ui frame given a list of windows

Source from the content-addressed store, hash-verified

491// polls input
492// does a ui frame given a list of windows
493int ui_DoFrame(bool input) {
494 int res = -1;
495 if (!UI_init)
496 return res;
497
498 // reset this flag here, so that print screen is valid only until next call to ui_DoFrame
499 if (input)
500 UI_input.printscreen = false;
501 if (input) {
502 ui_DoWindowFocus(); // determine window with current input focus.
503 res = ui_ProcessFocusedWindow(); // process focused window
504
505 // int64_t cur_time = timer_GetMSTime();
506 while ((timer_GetTime() - UI_input.cur_time) < UI_FRAMETIME) {
507 };
508
509 float temp_time = timer_GetTime();
510 UIFrameTime = temp_time - UI_input.cur_time;
511 UI_input.cur_time = temp_time;
512 }
513 ui_UpdateWindows();
514 ui_DoCursor(); // update mouse cursor position
515
516 return res;
517}
518// does a ui frame and gets mouse and key information.
519int ui_DoFrame(tUIInput *input, bool doinput) {
520 int res;

Callers 2

DoUIFrameFunction · 0.85
DoUIFrameWithoutInputFunction · 0.85

Calls 4

ui_DoWindowFocusFunction · 0.85
ui_ProcessFocusedWindowFunction · 0.85
ui_UpdateWindowsFunction · 0.85
ui_DoCursorFunction · 0.85

Tested by

no test coverage detected