]> git.xonotic.org Git - xonotic/darkplaces.git/blob - host.h
list: Add missing include guards.
[xonotic/darkplaces.git] / host.h
1 #ifndef HOST_H
2 #define HOST_H
3
4 typedef enum host_state_e
5 {
6         host_shutdown,
7         host_init,
8         host_loading,
9         host_active
10 } host_state_t;
11
12 typedef struct host_s
13 {
14         jmp_buf abortframe;
15         int state;
16         int framecount; // incremented every frame, never reset (checked by Host_Error and Host_SaveConfig_f)
17         double realtime; // the accumulated mainloop time since application started (with filtering), without any slowmo or clamping
18         double dirtytime; // the main loop wall time for this frame, equal to Sys_DirtyTime() at the start of this host frame
19         double sleeptime; // time spent sleeping overall
20         qbool restless; // don't sleep
21         qbool paused; // global paused state, pauses both client and server
22         cmd_buf_t *cbuf;
23
24         struct
25         {
26                 void (*ConnectLocal)(void);
27         } hook;
28 } host_t;
29
30 extern host_t host;
31
32 void Host_InitCommands(void);
33 void Host_Main(void);
34 double Host_Frame(double time);
35 void Host_Shutdown(void);
36 void Host_StartVideo(void);
37 void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN;
38 void Host_NoOperation_f(cmd_state_t *cmd);
39 void Host_LockSession(void);
40 void Host_UnlockSession(void);
41 void Host_AbortCurrentFrame(void);