summaryrefslogtreecommitdiff
path: root/source/loo/loo.cpp
diff options
context:
space:
mode:
authornasr <nsrddyn@gmail.com>2026-10-06 23:32:02 +0200
committernasr <nsrddyn@gmail.com>2026-10-06 23:32:02 +0200
commite467661baf3d035fb4726559abee52a0c8897ab0 (patch)
treef51bb6caf00a6bde1234fb58cd1285891fe4b4e6 /source/loo/loo.cpp
parentf6d3090f7fa76eb8e0dbe060b8490cb49c001c39 (diff)
feature: wayland connection
Diffstat (limited to 'source/loo/loo.cpp')
-rw-r--r--source/loo/loo.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/loo/loo.cpp b/source/loo/loo.cpp
new file mode 100644
index 0000000..e2de702
--- /dev/null
+++ b/source/loo/loo.cpp
@@ -0,0 +1,34 @@
1#include "base/base_include.h"
2
3ENTRYPOINT()
4{
5 MemArena *arena = ArenaCreate(MiB(100));
6 Assert(arena);
7
8int fd = wayland_display_connect(arena);
9
10 state_t state = {0};
11 state.wl_registry = wayland_wl_display_get_registry(fd),
12 state.w = 117,
13 state.h = 150,
14 state.stride = 117 * color_channels,
15 state.shm_pool_size = state.h * state.stride;
16
17
18 while (1) {
19 char read_buf[4096] = "";
20 int64_t read_bytes = recv(fd, read_buf, sizeof(read_buf), 0);
21 if (read_bytes == -1)
22 exit(errno);
23
24 char *msg = read_buf;
25 uint64_t msg_len = (uint64_t)read_bytes;
26
27 while (msg_len > 0)
28 wayland_handle_message(fd, &state, &msg, &msg_len);
29 }
30
31 return 0;
32
33
34}