diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-27 18:31:23 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-28 13:19:14 +0200 |
commit | 1e3df56a5c91bce2ef7b03e31156721e2f76a063 (patch) | |
tree | 9fd85a16ab3726581ed4745e100114d2674d9769 /include | |
parent | 3489e8682089c71c42b30eca80d7230b2ecf44f8 (diff) |
Move vertex buffer generation from init to first update, making init void
Diffstat (limited to 'include')
-rw-r--r-- | include/mgl/graphics/font.h | 2 | ||||
-rw-r--r-- | include/mgl/graphics/vertex_buffer.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/mgl/graphics/font.h b/include/mgl/graphics/font.h index 6aa9188..c4904ff 100644 --- a/include/mgl/graphics/font.h +++ b/include/mgl/graphics/font.h @@ -32,6 +32,6 @@ struct mgl_font { int mgl_font_load_from_file(mgl_font *self, const char *filepath, unsigned int character_size); void mgl_font_unload(mgl_font *self); -int mgl_font_get_glyph(mgl_font *self, uint32_t codepoint, mgl_font_glyph *glyph); +int mgl_font_get_glyph(const mgl_font *self, uint32_t codepoint, mgl_font_glyph *glyph); #endif /* MGL_FONT_H */ diff --git a/include/mgl/graphics/vertex_buffer.h b/include/mgl/graphics/vertex_buffer.h index 0dfd0d6..b8722da 100644 --- a/include/mgl/graphics/vertex_buffer.h +++ b/include/mgl/graphics/vertex_buffer.h @@ -21,11 +21,11 @@ typedef struct { mgl_vec2f position; } mgl_vertex_buffer; -int mgl_vertex_buffer_init(mgl_vertex_buffer *self, mgl_primitive_type primitive_type, mgl_vertex_buffer_usage usage); +void mgl_vertex_buffer_init(mgl_vertex_buffer *self); 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); +int mgl_vertex_buffer_update(mgl_vertex_buffer *self, const mgl_vertex *vertices, size_t vertex_count, mgl_primitive_type primitive_type, mgl_vertex_buffer_usage usage); /* |texture| can be NULL to not use any texture */ void mgl_vertex_buffer_draw(mgl_context *context, mgl_vertex_buffer *vertex_buffer, const mgl_texture *texture); |