aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-24 08:05:50 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-26 11:09:20 +0200
commit3489e8682089c71c42b30eca80d7230b2ecf44f8 (patch)
tree2413cb5bec912ab8213d4dc22bb69ea4467bb737 /include
parent115630b520668304af1ccd3eb0b13c06e17ecccc (diff)
Add clock
Diffstat (limited to 'include')
-rw-r--r--include/mgl/graphics/vertex_buffer.h2
-rw-r--r--include/mgl/system/clock.h13
2 files changed, 14 insertions, 1 deletions
diff --git a/include/mgl/graphics/vertex_buffer.h b/include/mgl/graphics/vertex_buffer.h
index 5cdadfa..0dfd0d6 100644
--- a/include/mgl/graphics/vertex_buffer.h
+++ b/include/mgl/graphics/vertex_buffer.h
@@ -27,6 +27,6 @@ void mgl_vertex_buffer_deinit(mgl_vertex_buffer *self);
void mgl_vertex_buffer_set_position(mgl_vertex_buffer *self, mgl_vec2f position);
int mgl_vertex_buffer_update(mgl_vertex_buffer *self, const mgl_vertex *vertices, size_t vertex_count);
/* |texture| can be NULL to not use any texture */
-void mgl_vertex_buffer_draw(mgl_context *context, mgl_vertex_buffer *self, const mgl_texture *texture);
+void mgl_vertex_buffer_draw(mgl_context *context, mgl_vertex_buffer *vertex_buffer, const mgl_texture *texture);
#endif /* MGL_VERTEX_BUFFER_H */
diff --git a/include/mgl/system/clock.h b/include/mgl/system/clock.h
new file mode 100644
index 0000000..f207ff7
--- /dev/null
+++ b/include/mgl/system/clock.h
@@ -0,0 +1,13 @@
+#ifndef MGL_CLOCK_H
+#define MGL_CLOCK_H
+
+typedef struct {
+ double captured_seconds;
+} mgl_clock;
+
+void mgl_clock_init(mgl_clock *self);
+/* Returns the elapsed time in seconds since the last restart or init, before resetting the clock */
+double mgl_clock_restart(mgl_clock *self);
+double mgl_clock_get_elapsed_time_seconds(mgl_clock *self);
+
+#endif /* MGL_CLOCK_H */