diff options
| author | realtradam <[email protected]> | 2023-03-05 06:38:09 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-03-05 06:38:09 -0500 |
| commit | e58d0577634b1405a40a4b1ebd0a36323fa81970 (patch) | |
| tree | e0facd0d5e396b07ef161dc7ef885c71694d0cbb /include/rodeo.h | |
| parent | eb6a382d03c5b9c915a949ea1119c2cbf72f1d6e (diff) | |
| download | RodeoKit-e58d0577634b1405a40a4b1ebd0a36323fa81970.tar.gz RodeoKit-e58d0577634b1405a40a4b1ebd0a36323fa81970.zip | |
initial rewrite to follow new styleguide
Diffstat (limited to 'include/rodeo.h')
| -rw-r--r-- | include/rodeo.h | 95 |
1 files changed, 65 insertions, 30 deletions
diff --git a/include/rodeo.h b/include/rodeo.h index 97a5e61..713e260 100644 --- a/include/rodeo.h +++ b/include/rodeo.h @@ -8,68 +8,103 @@ #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_window_do( \ + state, \ + screen_height, \ + screen_width, \ + title \ +) \ + mrodeo_defer_do( \ + rodeo_window_init( \ + &state, \ + screen_height, \ + screen_width, \ + title \ + ), \ + rodeo_window_deinit(state) \ + ) void -Rodeo__\ -init_window( - Rodeo__data_p *state, +rodeo_\ +window_init( + rodeo_data_p *state, int screen_height, int screen_width, char* title ); void -Rodeo__\ -deinit_window(Rodeo__data_p state); +rodeo_\ +window_deinit(rodeo_data_p state); void -Rodeo__\ -quit(); +rodeo_\ +deinit(void); + +#define \ +mrodeo_do( \ + state \ +) \ + mrodeo_defer_do( \ + rodeo_begin(state), \ + rodeo_end(state) \ + ) void -Rodeo__\ -begin(Rodeo__data_p state); +rodeo_\ +begin(rodeo_data_p state); void -Rodeo__\ -end(Rodeo__data_p state); +rodeo_\ +end(rodeo_data_p state); void -Rodeo__\ -execute_main_loop( - Rodeo__data_p state, - Rodeo__main_loop_p main_loop_function +rodeo_\ +mainloop_set( + rodeo_data_p state, + rodeo_mainloop_func main_loop_function ); bool -Rodeo__\ -should_quit(Rodeo__data_p state); +rodeo_\ +window_check_quit(rodeo_data_p state); void -Rodeo__\ -set_quit(Rodeo__data_p state, bool quit); +rodeo_\ +set_quit(rodeo_data_p state, bool quit); void -Rodeo__\ -draw_debug_text(uint16_t x, uint16_t y, const char *format, ...); +rodeo_\ +debug_text_draw(uint16_t x, uint16_t y, const char *format, ...); +// rodeo_renderer_name_get const char * -Rodeo__\ -get_renderer_name_as_string(); +rodeo_\ +renderer_name_get(void); +// rodeo_renderer_flush void -Rodeo__\ -flush_batch(Rodeo__data_p state); +rodeo_\ +renderer_flush(rodeo_data_p state); +// rodeo_rectangle_draw void -Rodeo__\ -draw_rectangle( - Rodeo__data_p state, +rodeo_\ +rectangle_draw( + rodeo_data_p state, uint16_t x, uint16_t y, uint16_t width, uint16_t height, - Rodeo__color_rgba_t color + rodeo_rgba_t color ); |
