aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index b822109..f02a603 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -44,8 +44,19 @@ pub fn main() !void {
log.debug("{}", .{shm});
}
- const pool = try wl.Shm.instances.items[0].create_pool(&ctx, 1024);
+ const pool = try wl.Shm.instances.items[0].create_pool(&ctx, 800 * 600 * (wl.Shm.Format.argb8888).bytes_per_pixel());
defer pool.deinit(&ctx);
try display.roundtrip(allocator);
+
+ const buffer = try pool.create_buffer(&ctx, 0, 800, 600, .argb8888);
+ defer ctx.display.request(buffer, .{ .destroy = {} }) catch |e| log.err("error {}", .{e});
+
+ const surface = try wl.Compositor.instances.items[0].create_surface(&ctx);
+ defer surface.deinit(&ctx);
+
+ try display.roundtrip(allocator);
+
+ log.debug("{}", .{buffer});
+ log.debug("{}", .{surface});
}