project for a (works on my devices) demo

This commit is contained in:
beno
2026-03-13 02:10:13 +01:00
parent 28f62d0b00
commit 425db27acc
26 changed files with 3553 additions and 60 deletions

View File

@@ -0,0 +1,55 @@
#pragma once
#include <wayland-client.h>
#include "../WAYLAND/xdg-shell.h"
typedef struct {
struct wl_compositor *compositor;
struct wl_subcompositor *subcompositor;
struct xdg_wm_base *xdg_wm_base;
struct wl_output *output;
} surface_builders;
typedef struct {
struct wl_display *display;
struct wl_registry *registry;
surface_builders *builders;
} wl_context;
#define GLUT_SCREEN_WIDTH 0
#define GLUT_SCREEN_HEIGHT 1
void global_registry(
void *data,
struct wl_registry *wl_registry,
uint32_t name,
const char *interface,
uint32_t version
);
void global_remove(
void *data,
struct wl_registry *wl_registry,
uint32_t name
);
/*
the only event dispatched by the WM is the "ping" one
emitted periodically to check if clients are still alive
calls
xdg_wm_base_pong
to inform the server that the client is alive and responsive
*/
void wm_ping(
void *data,
struct xdg_wm_base *xdg_wm_base,
uint32_t serial);
/* connects to the default display and initializes basic wayland resources */
wl_context* wl_context_new();
int wl_context_get( int query);