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