Change generated image to green-blue gradient

dev
LeRoyce Pearson 2023-08-10 19:23:36 -06:00
parent d224b186a2
commit 8878108c6f
1 changed files with 10 additions and 7 deletions

View File

@ -218,13 +218,16 @@ pub fn main() !void {
const framebuffer = @as([*][4]u8, @ptrCast(framebuffer_bytes.ptr))[0 .. framebuffer_bytes.len / @sizeOf([4]u8)]; const framebuffer = @as([*][4]u8, @ptrCast(framebuffer_bytes.ptr))[0 .. framebuffer_bytes.len / @sizeOf([4]u8)];
// put some interesting colors into the framebuffer // put some interesting colors into the framebuffer
for (framebuffer, 0..) |*pixel, i| { for (0..framebuffer_size[1]) |y| {
pixel.* = .{ const row = framebuffer[y * framebuffer_size[0] .. (y + 1) * framebuffer_size[0]];
@truncate(i), for (row, 0..framebuffer_size[0]) |*pixel, x| {
@truncate(i + 64), pixel.* = .{
@truncate(i + 128), @truncate(x),
0xFF, @truncate(y),
}; 0x00,
0xFF,
};
}
} }
const wl_shm_pool_id = 10; const wl_shm_pool_id = 10;