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,14 +218,17 @@ 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| {
const row = framebuffer[y * framebuffer_size[0] .. (y + 1) * framebuffer_size[0]];
for (row, 0..framebuffer_size[0]) |*pixel, x| {
pixel.* = .{ pixel.* = .{
@truncate(i), @truncate(x),
@truncate(i + 64), @truncate(y),
@truncate(i + 128), 0x00,
0xFF, 0xFF,
}; };
} }
}
const wl_shm_pool_id = 10; const wl_shm_pool_id = 10;
{ {