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