Change generated image to green-blue gradient
parent
d224b186a2
commit
8878108c6f
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue