Closed logankaser closed 9 months ago
I would prefer adding that as a field to sg_pixelformat_info
returned by the sg_query_pixelformat
call.
Thoughts?
That seems like a great place to add it!
I'll start looking into this today.
Ok, this is now merged. I also exposed two helper functions to compute the number of bytes in a texture row and surface, which might actually be a bit more useful.
Details are in the changelog https://github.com/floooh/sokol/blob/master/CHANGELOG.md#06-jan-2024, and also in the sokol_gfx.h documentation comments.
_sg_pixelformat_bytesize
Would be useful to expose to users. I have a texture manager abstraction that internally creates sg_images. Its API acceptssg_pixel_format
(s) from callers, and width and height parameters, and it would be nice to be able to use_sg_pixelformat_bytesize
to calculate data size.