It works!

This commit is contained in:
2025-11-26 15:47:02 +01:00
parent 9f2d1e4608
commit b9a804ead6
8 changed files with 150 additions and 88 deletions

View File

@@ -170,6 +170,11 @@ fn loadTexture(engine: *Engine, filename: []const u8, usage: Texture.Usage, temp
var img = try stbi.Image.loadFromMemory(file_buf, usage.samplesPerTexel());
defer img.deinit();
std.debug.assert(img.num_components == usage.samplesPerTexel());
if (usage == .normal) {
for (img.data) |*sample| {
sample.* = sample.* +% 128;
}
}
var texture = try Texture.init(engine, .{
.width = img.width,