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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
// public internal
#include "rodeo_types.h"
// system
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdarg.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 \
) \
#define \
mrodeo_vargs_do(final_arg) \
va_list vargs; \
mrodeo_defer_do( \
va_start(vargs, final_arg), \
va_end(vargs) \
) \
/// --- 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_function main_loop_func
);
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_t
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_t
rodeo_string_create(const char *c_string);
void
rodeo_string_destroy(rodeo_string_t *self);
char*
rodeo_string_to_cstr(rodeo_string_t *self);
const char*
rodeo_string_to_constcstr(const rodeo_string_t *self);
void
rodeo_string_insert(
rodeo_string_t *self,
const rodeo_string_t insert,
intptr_t position
);
void
rodeo_string_append(
rodeo_string_t *self,
const rodeo_string_t append
);
void
rodeo_string_prepend(
rodeo_string_t *self,
const rodeo_string_t prepend
);
void
rodeo_string_clear(rodeo_string_t *self);
void
rodeo_string_set(rodeo_string_t *self, char *value);
rodeo_string_t
rodeo_string_clone(const rodeo_string_t self);
rodeo_string_t
rodeo_string_format(const char *format, ...);
/// --- Log ---
void
rodeo_log(
rodeo_loglevel_t loglevel,
const char *format,
...
);
/// --- Framerate ---
uint64_t
rodeo_frame_count_get(void);
float
rodeo_frame_time_get(void);
float
rodeo_frame_persecond_get(void);
void
rodeo_frame_limit_set(uint32_t limit);
/// --- Input ---
int32_t
rodeo_input_mouse_x_get(void);
int32_t
rodeo_input_mouse_y_get(void);
|