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

Function PollUI

Descent3/multi_dll_mgr.cpp:802–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800float UI_LastPoll = 0l;
801#define MIN_FRAMETIME .033
802int PollUI(void) {
803 // this should poll UI_frame_result.
804 int result = -1;
805
806 ui_ShowCursor();
807
808 // Limit this to a fixed framerate
809 if (UI_LastPoll) {
810 if ((timer_GetTime() - UI_LastPoll) < MIN_FRAMETIME)
811 Sleep((timer_GetTime() - UI_LastPoll) * 1000);
812 }
813
814 UI_LastPoll = timer_GetTime();
815
816 Descent->defer();
817 DoUIFrame();
818 rend_Flip();
819 result = GetUIFrameResult();
820 if (result != -1) {
821 ui_HideCursor();
822 ui_Flush();
823 ddio_KeyFlush();
824 }
825 return result;
826}
827void *CreateNewUITextItem(const char *newtext, uint32_t color, int font) {
828 UITextItem *new_text_item;
829 if (font == -1) {

Callers 1

ShowNetgameInfoFunction · 0.85

Calls 9

ui_ShowCursorFunction · 0.85
DoUIFrameFunction · 0.85
GetUIFrameResultFunction · 0.85
ui_HideCursorFunction · 0.85
ui_FlushFunction · 0.85
ddio_KeyFlushFunction · 0.85
SleepFunction · 0.50
rend_FlipFunction · 0.50
deferMethod · 0.45

Tested by

no test coverage detected