emicarra
Member
Hello, i have a little online chat and i'm creating a buffer to send a string (1 byte) and a colour value (4 bytes).
Since i have a 4 bytes (buffer_u32) colour value, do i have to use alignment 4 in my buffer? Or can i set it to 1? Because im sending a string in the same buffer, and i think if i send a 1 byte string in a buffer with alignment 4 i'm just wasting space and making it heavier.
I'm confused because in the game maker manual, it says buffer_u32 (4 bytes) should be aligned to 4 bytes, but in an image that appears more at the bottom, it shows 2 byte data aliged to 1 byte.
Maybe i'm confused and that's not how it works
Since i have a 4 bytes (buffer_u32) colour value, do i have to use alignment 4 in my buffer? Or can i set it to 1? Because im sending a string in the same buffer, and i think if i send a 1 byte string in a buffer with alignment 4 i'm just wasting space and making it heavier.
I'm confused because in the game maker manual, it says buffer_u32 (4 bytes) should be aligned to 4 bytes, but in an image that appears more at the bottom, it shows 2 byte data aliged to 1 byte.
Maybe i'm confused and that's not how it works