-
Notifications
You must be signed in to change notification settings - Fork 0
/
console.h
52 lines (37 loc) · 2.09 KB
/
console.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef CONSOLE_H
#define CONSOLE_H
// This is the shared code for the display and subsystem/variable part
// This is a Quake style console. Everyone loves these!
// There is only one global console.
#include "public/console_api.h"
void console_initialize(struct graphics_context_api* graphics);
void console_printf(char* text, ...);
void console_clear(void);
// ASCII only console.
void console_send_character(char character);
void console_submit(void);
void console_display(struct graphics_context_api* graphics);
void console_allow_submission(void);
// up to the game to respect this.
bool console_active(void);
void console_scroll_by(float amount);
void console_send_key_event(bool key_down_event, uint32_t keycode, bool alt_state, bool ctrl_state, bool shift_state);
static char* console_system_variable_type_as_string(uint8_t type);
static char* console_system_number_type_as_string(uint8_t type);
// These iterators are identical.
typedef struct console_system_variable_iterator {
struct console_system_variable* current;
} console_system_variable_iterator;
typedef struct console_system_command_iterator {
struct console_system_command* current;
} console_system_command_iterator;
console_system_variable_iterator console_system_begin_iterating_variables(void);
bool console_system_variable_iterator_finished(console_system_variable_iterator* iterator);
struct console_system_variable* console_system_variable_iterator_advance(console_system_variable_iterator* iterator);
console_system_command_iterator console_system_begin_iterating_commands(void);
bool console_system_command_iterator_finished(console_system_command_iterator* iterator);
struct console_system_command* console_system_command_iterator_advance(console_system_command_iterator* iterator);
void console_system_register_command(struct console_system_command* command);
void console_system_register_variable(struct console_system_variable* variable);
struct console_system_variable* console_system_find_variable(char* name);
#endif