summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2023-03-26 00:52:13 -0400
committerrealtradam <[email protected]>2023-03-26 00:52:13 -0400
commit4670ac42a773ea97157f71d78687f79d6ba3c1d9 (patch)
tree3c70b7d4073d48ff3c5066c9cf7ab812031a3551 /include
parent2577adf913e292a4a515e7dfc4023e37e8177f46 (diff)
downloadRodeoKit-4670ac42a773ea97157f71d78687f79d6ba3c1d9.tar.gz
RodeoKit-4670ac42a773ea97157f71d78687f79d6ba3c1d9.zip
added loading images as well as loding textures
Diffstat (limited to 'include')
-rw-r--r--include/rodeo.h49
-rw-r--r--include/rodeo_types.h31
2 files changed, 41 insertions, 39 deletions
diff --git a/include/rodeo.h b/include/rodeo.h
index f54792b..b67970c 100644
--- a/include/rodeo.h
+++ b/include/rodeo.h
@@ -32,14 +32,16 @@ mrodeo_vargs_do(final_arg) \
/// --- Math ---
-rodeo_RGBA8_t
-rodeo_RGBAFloat_to_RGBA8(const rodeo_RGBAFloat_t color);
+rodeo_color_RGBA8_t
+rodeo_color_RGBAFloat_to_RGBA8(const rodeo_color_RGBAFloat_t color);
-rodeo_BGRA8_t
-rodeo_RGBA8_to_BGRA8(const rodeo_RGBA8_t color);
-/// --- Core ---
+rodeo_color_RGBAFloat_t
+rodeo_color_RGBA8_to_RGBAFloat(const rodeo_color_RGBA8_t color);
+
+int32_t
+rodeo_random_simple_get(void);
-extern rodeo_texture_2d_t rodeo_texture_2d_default;
+/// --- Core ---
#define \
mrodeo_window_do( \
@@ -82,15 +84,15 @@ void
rodeo_frame_end(void);
void
-rodeo_mainloop_run(
+rodeo_mainLoop_run(
rodeo_mainLoop_function main_loop_func
);
bool
-rodeo_window_check_quit(void);
+rodeo_window_quit_get(void);
void
-rodeo_set_quit(bool quit);
+rodeo_window_quit_set(bool quit);
void
rodeo_debug_text_draw(uint16_t x, uint16_t y, const char *format, ...);
@@ -101,11 +103,8 @@ rodeo_renderer_name_get(void);
void
rodeo_renderer_flush(void);
-void
-rodeo_rectangle_draw(
- rodeo_rectangle_t rectangle,
- rodeo_RGBAFloat_t color
-);
+const rodeo_texture_2d_t*
+rodeo_texture_2d_default_get(void);
rodeo_texture_2d_t
rodeo_texture_2d_create_from_RGBA8(
@@ -114,11 +113,23 @@ rodeo_texture_2d_create_from_RGBA8(
const uint8_t memory[]
);
+rodeo_texture_2d_t
+rodeo_texture_2d_create_from_path(rodeo_string_t path);
+
+void
+rodeo_texture_2d_destroy(rodeo_texture_2d_t *texture);
+
+void
+rodeo_rectangle_draw(
+ const rodeo_rectangle_t *rectangle,
+ const rodeo_color_RGBAFloat_t *color
+);
+
void
rodeo_texture_2d_draw(
- const rodeo_rectangle_t source,
- const rodeo_rectangle_t destination,
- const rodeo_RGBAFloat_t color,
+ const rodeo_rectangle_t *destination,
+ const rodeo_rectangle_t *source,
+ const rodeo_color_RGBAFloat_t *color,
const rodeo_texture_2d_t *texture
);
@@ -174,7 +185,7 @@ rodeo_string_vargs_format(const char *format, va_list vargs);
void
rodeo_log(
- rodeo_loglevel_t loglevel,
+ rodeo_logLevel_t loglevel,
const char *format,
...
);
@@ -188,7 +199,7 @@ float
rodeo_frame_time_get(void);
float
-rodeo_frame_persecond_get(void);
+rodeo_frame_perSecond_get(void);
void
rodeo_frame_limit_set(uint32_t limit);
diff --git a/include/rodeo_types.h b/include/rodeo_types.h
index 5f9925e..18c3691 100644
--- a/include/rodeo_types.h
+++ b/include/rodeo_types.h
@@ -18,7 +18,7 @@ typedef union
};
float array[4];
}
-rodeo_RGBAFloat_t;
+rodeo_color_RGBAFloat_t;
typedef union
{
@@ -32,28 +32,19 @@ typedef union
uint32_t rgba;
uint8_t array[4];
}
-rodeo_RGBA8_t;
+rodeo_color_RGBA8_t;
-typedef union
-{
- struct
- {
- uint8_t blue;
- uint8_t green;
- uint8_t red;
- uint8_t alpha;
- };
- uint32_t bgra;
- uint8_t array[4];
-}
-rodeo_BGRA8_t;
typedef struct
{
float x;
float y;
float z;
- uint32_t bgra;
+ rodeo_color_RGBAFloat_t color;
+ //float red;
+ //float green;
+ //float blue;
+ //float alpha;
float texture_x;
float texture_y;
float texture_id;
@@ -106,11 +97,11 @@ typedef union {
typedef enum
{
- rodeo_loglevel_info,
- rodeo_loglevel_warning,
- rodeo_loglevel_error
+ rodeo_logLevel_info,
+ rodeo_logLevel_warning,
+ rodeo_logLevel_error
}
-rodeo_loglevel_t;
+rodeo_logLevel_t;
typedef
void