]> icculus.org git repositories - btb/d2x.git/blob - include/console.h
add callback for console hide. disable controls when open.
[btb/d2x.git] / include / console.h
1 /* Console */
2
3 #ifndef _CONSOLE_H_
4 #define _CONSOLE_H_ 1
5
6 #include "pstypes.h"
7
8 /* Priority levels */
9 #define CON_CRITICAL -2
10 #define CON_URGENT   -1
11 #define CON_NORMAL    0
12 #define CON_VERBOSE   1
13 #define CON_DEBUG     2
14
15 int  con_init(void);
16 void con_init_gfx(void);
17 void con_resize(void);
18 void con_printf(int level, char *fmt, ...);
19
20 void con_show(void);
21 void con_draw(void);
22 void con_update(void);
23 int  con_events(int key);
24
25 /* CVar stuff */
26 typedef struct cvar_s
27 {
28         char *name;
29         char *string;
30         dboolean archive;
31         float value;
32         struct cvar_s *next;
33 } cvar_t;
34
35 extern int Console_open;
36 extern cvar_t *cvar_vars;
37
38 /* Register a CVar with the name and string and optionally archive elements set */
39 void cvar_registervariable (cvar_t *cvar);
40
41 /* Equivalent to typing <var_name> <value> at the console */
42 void cvar_set(char *cvar_name, char *value);
43
44 /* Get a CVar's value */
45 float cvar(char *cvar_name);
46
47 /* Console CVars */
48 /* How discriminating we are about which messages are displayed */
49 extern cvar_t con_threshold;
50
51 #endif /* _CONSOLE_H_ */
52