I'm curious about the use of the CreateEvent() function in Quake.
We have the following global in the c file that WinMain() is defined in:
static HANDLE tevent;
In the WinMain() function itself, we see this:
tevent = CreateEvent(NULL, FALSE, FALSE, NULL);
The game exits if this creation fails.
It then appears in a following function:
void SleepUntilInput (int time)
{
MsgWaitForMultipleObjects (1, &tevent, FALSE, time, QS_ALLINPUT);
}
And finally CloseHandle(tevent) is called in the Quit function.
I'm unfamiliar with WinAPI, so this leaves me with two questions.
-What does this use of CreateEvent() return?
-How does this make the SleepUntilInput() function work properly?