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)];
// put some interesting colors into the framebuffer
for (framebuffer, 0..) |*pixel, i| {
pixel.* = .{
@truncate(i),
@truncate(i + 64),
@truncate(i + 128),
0xFF,
};
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.* = .{
@truncate(x),
@truncate(y),
0x00,
0xFF,
};
}
}
const wl_shm_pool_id = 10;