diff options
| author | nasr <nsrddyn@gmail.com> | 2026-10-09 12:37:56 +0200 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-10-09 12:37:56 +0200 |
| commit | 9a2fe3e091849518f3d2f79114ba67fa4fc63adf (patch) | |
| tree | 62678a2ff13752d8f8916aca8b6ff70d9bbd6d80 /source/loo/loo.cpp | |
| parent | e467661baf3d035fb4726559abee52a0c8897ab0 (diff) | |
feature: window with sqaures etc etcmain
Diffstat (limited to 'source/loo/loo.cpp')
| -rw-r--r-- | source/loo/loo.cpp | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/source/loo/loo.cpp b/source/loo/loo.cpp index e2de702..3a2cfef 100644 --- a/source/loo/loo.cpp +++ b/source/loo/loo.cpp | |||
| @@ -5,30 +5,10 @@ ENTRYPOINT() | |||
| 5 | MemArena *arena = ArenaCreate(MiB(100)); | 5 | MemArena *arena = ArenaCreate(MiB(100)); |
| 6 | Assert(arena); | 6 | Assert(arena); |
| 7 | 7 | ||
| 8 | int fd = wayland_display_connect(arena); | 8 | LinuxWindowParams *params = PushStruct(arena, LinuxWindowParams); |
| 9 | params->name = (cstring)"Loo"; | ||
| 9 | 10 | ||
| 10 | state_t state = {0}; | 11 | wayland_entrypoint(arena, params); |
| 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 | 12 | ||
| 31 | return 0; | 13 | return 0; |
| 32 | |||
| 33 | |||
| 34 | } | 14 | } |
