summaryrefslogtreecommitdiff
path: root/src/rendering.cc
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-11 22:03:38 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-11 22:03:38 +0100
commitf1e9a3fa502843f0f3092e4bbb016c14eec43fcc (patch)
treeb96e84f9717d185a4e03b829c5bb173d6d432eb7 /src/rendering.cc
parent616d099498ec573ec32ec1eb91ddc076c7622d31 (diff)
add ability to choose custom alignment
Diffstat (limited to 'src/rendering.cc')
-rw-r--r--src/rendering.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rendering.cc b/src/rendering.cc
index 3870cf6..a34e01c 100644
--- a/src/rendering.cc
+++ b/src/rendering.cc
@@ -27,9 +27,12 @@ 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) {
wayc_notnull(data);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
+
switch (type) {
case IMAGE_TYPE_2D:
// TODO: add error checking
@@ -105,12 +108,12 @@ 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) {
wayc_notnull(atlas);
wayc_notnull(data);
wayc_image_upload(atlas->texture, offset, width, height, IMAGE_TYPE_2D,
- atlas->format, data_type, data);
+ atlas->format, data_type, alignment, data);
}
void wayc_atlas_deinit(atlas_s* atlas) {