feat: switch from BGR555 to RGBA8888

This commit is contained in:
2022-03-18 06:27:37 -03:00
parent 39ab363afa
commit 3d61c0dba4
3 changed files with 75 additions and 19 deletions

View File

@@ -42,3 +42,14 @@ pub const FpsAverage = struct {
self.sample_count = 1;
}
};
pub fn intToBytes(comptime T: type, value: anytype) [@sizeOf(T)]u8 {
comptime std.debug.assert(@typeInfo(T) == .Int);
var result: [@sizeOf(T)]u8 = undefined;
var i: Log2Int(T) = 0;
while (i < result.len) : (i += 1) result[i] = @truncate(u8, value >> i * @bitSizeOf(u8));
return result;
}