aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-22 07:03:45 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-22 08:18:09 +0200
commitdf2e6771c5bf6f09e62f9d6b86d83a2631ea365f (patch)
tree97eef20a43f4b240ecb173b08df3c60c4f8658fb /include
parentfaa74e2c942102a9b1aa215a913fddf422714d7e (diff)
Use const where possible in function params
Diffstat (limited to 'include')
-rw-r--r--include/mgl/graphics/shader.h2
-rw-r--r--include/mgl/graphics/texture.h2
-rw-r--r--include/mgl/graphics/vertex.h2
-rw-r--r--include/mgl/graphics/vertex_buffer.h4
4 files changed, 5 insertions, 5 deletions
diff --git a/include/mgl/graphics/shader.h b/include/mgl/graphics/shader.h
index fb00066..ec89df7 100644
--- a/include/mgl/graphics/shader.h
+++ b/include/mgl/graphics/shader.h
@@ -19,7 +19,7 @@ int mgl_shader_program_init(mgl_shader_program *self);
void mgl_shader_program_deinit(mgl_shader_program *self);
int mgl_shader_program_add_shader_from_file(mgl_shader_program *self, const char *filepath, mgl_shader_type shader_type);
-int mgl_shader_program_add_shader_from_memory(mgl_shader_program *self, unsigned char *shader_data, int shader_size, mgl_shader_type shader_type);
+int mgl_shader_program_add_shader_from_memory(mgl_shader_program *self, const unsigned char *shader_data, int shader_size, mgl_shader_type shader_type);
int mgl_shader_program_finalize(mgl_shader_program *self);
int mgl_shader_program_set_uniform_vec2f(mgl_shader_program *self, const char *uniform_name, mgl_vec2f value);
diff --git a/include/mgl/graphics/texture.h b/include/mgl/graphics/texture.h
index 3aec07d..7891dab 100644
--- a/include/mgl/graphics/texture.h
+++ b/include/mgl/graphics/texture.h
@@ -28,7 +28,7 @@ typedef struct {
/* |load_options| can be null, in which case the default options are used */
int mgl_texture_load_from_file(mgl_texture *self, const char *filepath, mgl_texture_load_options *load_options);
/* |load_options| can be null, in which case the default options are used */
-int mgl_texture_load_from_image(mgl_texture *self, mgl_image *image, mgl_texture_load_options *load_options);
+int mgl_texture_load_from_image(mgl_texture *self, const mgl_image *image, mgl_texture_load_options *load_options);
/* |load_options| can be null, in which case the default options are used */
int mgl_texture_load_from_memory(mgl_texture *self, const unsigned char *data, int width, int height, mgl_image_format format, mgl_texture_load_options *load_options);
void mgl_texture_unload(mgl_texture *self);
diff --git a/include/mgl/graphics/vertex.h b/include/mgl/graphics/vertex.h
index b4a5830..69400b4 100644
--- a/include/mgl/graphics/vertex.h
+++ b/include/mgl/graphics/vertex.h
@@ -6,8 +6,8 @@
typedef struct {
mgl_vec2f position;
- mgl_color color;
mgl_vec2f texcoords;
+ mgl_color color;
} mgl_vertex;
#endif /* MGL_VERTEX_H */
diff --git a/include/mgl/graphics/vertex_buffer.h b/include/mgl/graphics/vertex_buffer.h
index c1e4af1..2a32d3d 100644
--- a/include/mgl/graphics/vertex_buffer.h
+++ b/include/mgl/graphics/vertex_buffer.h
@@ -37,8 +37,8 @@ int mgl_vertex_buffer_init(mgl_vertex_buffer *self, mgl_primitive_type primitive
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, mgl_vertex *vertices, size_t vertex_count);
+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, mgl_texture *texture);
+void mgl_vertex_buffer_draw(mgl_context *context, mgl_vertex_buffer *self, const mgl_texture *texture);
#endif /* MGL_VERTEX_BUFFER_H */