summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2023-03-05 06:38:09 -0500
committerrealtradam <[email protected]>2023-03-05 06:38:09 -0500
commite58d0577634b1405a40a4b1ebd0a36323fa81970 (patch)
treee0facd0d5e396b07ef161dc7ef885c71694d0cbb /include
parenteb6a382d03c5b9c915a949ea1119c2cbf72f1d6e (diff)
downloadRodeoKit-e58d0577634b1405a40a4b1ebd0a36323fa81970.tar.gz
RodeoKit-e58d0577634b1405a40a4b1ebd0a36323fa81970.zip
initial rewrite to follow new styleguide
Diffstat (limited to 'include')
-rw-r--r--include/rodeo.h95
-rw-r--r--include/rodeo_math.h2
-rw-r--r--include/rodeo_types.h19
3 files changed, 74 insertions, 42 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
);
diff --git a/include/rodeo_math.h b/include/rodeo_math.h
index f7df53f..4dee9ae 100644
--- a/include/rodeo_math.h
+++ b/include/rodeo_math.h
@@ -8,4 +8,4 @@
uint32_t
Rodeo__\
Math__\
-color_rgba_to_uint32(const Rodeo__color_rgba_t color);
+color_rgba_to_uint32(const rodeo_rgba_t color);
diff --git a/include/rodeo_types.h b/include/rodeo_types.h
index 47d2db9..e35c482 100644
--- a/include/rodeo_types.h
+++ b/include/rodeo_types.h
@@ -6,37 +6,34 @@
typedef
struct
-Rodeo__\
-color_rgba
{
float red;
float green;
float blue;
float alpha;
}
-Rodeo__\
-color_rgba_t;
+rodeo_\
+rgba_t;
typedef
struct
-Rodeo__position_color_vertex
{
float x;
float y;
float z;
uint32_t abgr;
}
-Rodeo__\
+rodeo_\
position_color_vertex_t;
+//rodeo_poscolvert_t
typedef
struct
-Rodeo__data
-*Rodeo__\
-data_p;
+rodeo_data_t
+*rodeo_data_p;
typedef
void
-(*Rodeo__\
-main_loop_p)
+(*rodeo_\
+mainloop_func)
(void);