Handmade Hero»Forums»Code
39 posts
negative "Buffer->Pitch"
Some platforms don't seem to have an option to do rendering from the bottom up like on windows.

This was worked around by passing a negative value for Buffer->Pitch from the platform layer to the game code to get an upside down buffer back, which would render normally when rendered from the top down.

SafeTruncateToUInt16(Buffer->Pitch) prevents this hack.

The buffer can still be manually flipped in the platform code if need be.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
negative "Buffer->Pitch"
We could change it to a SafeTruncateToInt16 if you remind me...

- Casey