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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
// public internal
#include "rodeo_types.h"
// system
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <limits.h>
#define mrodeo_name_concat(prefix, suffix) prefix##suffix
#define mrodeo_macrovar(prefix) mrodeo_name_concat(prefix##_, __LINE__)
#define mrodeo_defer_do(start, end) for( \
int mrodeo_macrovar(_macrovar_) = (start, 0); \
!mrodeo_macrovar(_macrovar_); \
(mrodeo_macrovar(_macrovar_) += 1), end) \
/// --- Math ---
uint32_t
rodeo_rgba_to_uint32(const rodeo_rgba_t color);
/// --- Core ---
#define \
mrodeo_window_do( \
screen_height, \
screen_width, \
title \
) \
mrodeo_defer_do( \
rodeo_window_init( \
screen_height, \
screen_width, \
title \
), \
rodeo_window_deinit() \
)
void
rodeo_window_init(
int screen_height,
int screen_width,
char* title
);
void
rodeo_window_deinit(void);
#define \
mrodeo_frame_do( \
state \
) \
mrodeo_defer_do( \
rodeo_frame_begin(state), \
rodeo_frame_end(state) \
)
void
rodeo_frame_begin(void);
void
rodeo_frame_end(void);
void
rodeo_mainloop_run(
rodeo_mainloop_func main_loop_function
);
bool
rodeo_window_check_quit(void);
void
rodeo_set_quit(bool quit);
void
rodeo_debug_text_draw(uint16_t x, uint16_t y, const char *format, ...);
rodeo_string_p
rodeo_renderer_name_get(void);
void
rodeo_renderer_flush(void);
void
rodeo_rectangle_draw(
rodeo_rectangle_t rectangle,
rodeo_rgba_t color
);
/// --- String ---
rodeo_string_p
rodeo_string_create(const char *c_string);
void
rodeo_string_destroy(rodeo_string_p self);
char*
rodeo_string_to_cstr(rodeo_string_p self);
const char*
rodeo_string_to_constcstr(rodeo_string_p self);
void
rodeo_string_insert(
rodeo_string_p self,
const rodeo_string_p insert,
intptr_t position
);
void
rodeo_string_append(
rodeo_string_p self,
const rodeo_string_p append
);
void
rodeo_string_prepend(
rodeo_string_p self,
const rodeo_string_p prepend
);
void
rodeo_string_clear(rodeo_string_p self);
void
rodeo_string_set(rodeo_string_p self, char* value);
|