summaryrefslogtreecommitdiffhomepage
path: root/include/rodeo/gfx.h
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2023-06-04 02:35:00 -0400
committerrealtradam <[email protected]>2023-06-04 02:35:00 -0400
commit35558b39040d37c939bd68b56985d6cb5385a451 (patch)
treeb10516557ba530d96799a8c4bed94b7644938811 /include/rodeo/gfx.h
parent856ce67eb21f64d86ecf6bb3651985f10e6236c3 (diff)
downloadRodeoKit-35558b39040d37c939bd68b56985d6cb5385a451.tar.gz
RodeoKit-35558b39040d37c939bd68b56985d6cb5385a451.zip
refactor to have graphics and windowing seperategfx-rewrite
Diffstat (limited to 'include/rodeo/gfx.h')
-rw-r--r--include/rodeo/gfx.h98
1 files changed, 98 insertions, 0 deletions
diff --git a/include/rodeo/gfx.h b/include/rodeo/gfx.h
new file mode 100644
index 0000000..28d46ff
--- /dev/null
+++ b/include/rodeo/gfx.h
@@ -0,0 +1,98 @@
+#pragma once
+
+// -- internal --
+// public
+#include "rodeo/gfx_t.h"
+
+// -- external --
+#include "stc/cstr.h"
+
+void
+rodeo_gfx_init(void);
+
+void
+rodeo_gfx_deinit(void);
+
+void
+rodeo_gfx_frame_begin(void);
+
+void
+rodeo_gfx_frame_end(void);
+
+cstr
+rodeo_gfx_renderer_name_get(void);
+
+void
+rodeo_gfx_renderer_flush(void);
+
+const rodeo_gfx_texture_2d_t*
+rodeo_gfx_texture_2d_default_get(void);
+
+rodeo_gfx_texture_2d_t
+rodeo_gfx_texture_2d_create_from_RGBA8(
+ const uint16_t width,
+ const uint16_t height,
+ const uint8_t memory[]
+);
+
+rodeo_gfx_texture_2d_t
+rodeo_gfx_texture_2d_create_from_path(cstr path);
+
+void
+rodeo_gfx_texture_2d_destroy(rodeo_gfx_texture_2d_t *texture);
+
+void
+rodeo_gfx_rectangle_draw(
+ const rodeo_rectangle_t *rectangle,
+ const rodeo_color_RGBAFloat_t *color
+);
+
+void
+rodeo_gfx_texture_2d_draw(
+ const rodeo_rectangle_t *destination,
+ const rodeo_rectangle_t *source,
+ const rodeo_color_RGBAFloat_t *color,
+ const rodeo_gfx_texture_2d_t *texture
+);
+
+void
+rodeo_gfx_renderer_flush(void);
+
+uint32_t
+rodeo_gfx_frame_limit_get(void);
+
+cstr
+rodeo_gfx_renderer_name_get(void);
+
+uint64_t
+rodeo_gfx_frame_count_get(void);
+
+float
+rodeo_gfx_frame_time_get(void);
+
+float
+rodeo_gfx_frame_perSecond_get(void);
+
+void
+rodeo_gfx_frame_limit_set(uint32_t limit);
+
+uint32_t
+rodeo_gfx_frame_limit_get(void);
+
+#define \
+mrodeo_gfx_do( \
+) \
+ mrodeo_defer_do( \
+ rodeo_gfx_init(), \
+ rodeo_gfx_deinit() \
+ )
+
+
+#define \
+mrodeo_gfx_frame_do( \
+) \
+ mrodeo_defer_do( \
+ rodeo_gfx_frame_begin(), \
+ rodeo_gfx_frame_end() \
+ )
+