From f1e9a3fa502843f0f3092e4bbb016c14eec43fcc Mon Sep 17 00:00:00 2001 From: Fabrice Date: Wed, 11 Feb 2026 22:03:38 +0100 Subject: add ability to choose custom alignment --- src/rendering.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/rendering.h') diff --git a/src/rendering.h b/src/rendering.h index 85d3d88..7e5e46e 100644 --- a/src/rendering.h +++ b/src/rendering.h @@ -19,6 +19,11 @@ enum image_data_type_e { IMAGE_DATA_TYPE_UNSIGNED_BYTE = GL_UNSIGNED_BYTE, }; +enum { + IMAGE_FORMAT_RGBA_ALIGNMENT = 4, + IMAGE_FORMAT_RED_ALIGNMENT = 1, +}; + typedef u32 texture_t; bool wayc_image_init(texture_t* texture, image_type_e type, @@ -26,7 +31,8 @@ bool wayc_image_init(texture_t* texture, image_type_e type, bool wayc_image_upload(texture_t texture, ivec2 offset, u32 width, u32 height, image_type_e type, image_format_e format, - image_data_type_e data_type, const u8* data); + image_data_type_e data_type, i32 alignment, + const u8* data); void wayc_image_use(texture_t texture, u32 slot); void wayc_image_deinit(texture_t* texture); @@ -59,5 +65,5 @@ bool wayc_atlas_init(atlas_s* atlas, image_format_e format, u32 width, u32 height); void wayc_atlas_use(atlas_s* atlas, u32 slot); void wayc_atlas_set(atlas_s* atlas, image_data_type_e data_type, ivec2 offset, - u32 width, u32 height, const u8* data); + u32 width, u32 height, i32 alignment, const u8* data); void wayc_atlas_deinit(atlas_s* atlas); -- cgit v1.2.3