ui_DoFrame polls input does a ui frame given a list of windows
| 491 | // polls input |
| 492 | // does a ui frame given a list of windows |
| 493 | int 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. |
| 519 | int ui_DoFrame(tUIInput *input, bool doinput) { |
| 520 | int res; |
no test coverage detected