black screen!

This commit is contained in:
Rakarake 2025-12-18 01:42:43 +01:00
parent 5f08179427
commit 6565663d56

View file

@ -93,8 +93,9 @@ xdg_surface_configure(void *data,
struct client_state *state = data;
xdg_surface_ack_configure(xdg_surface, serial);
struct wl_buffer *buffer = draw_frame(state);
wl_surface_attach(state->wl_surface, buffer, 0, 0);
// TODO do egl stuff here instead?
//struct wl_buffer *buffer = draw_frame(state);
//wl_surface_attach(state->wl_surface, buffer, 0, 0);
wl_surface_commit(state->wl_surface);
}
@ -121,13 +122,15 @@ registry_handle_global(void *data, struct wl_registry *registry,
struct client_state *state = data;
if (strcmp(interface, wl_shm_interface.name) == 0) {
state->wl_shm = wl_registry_bind(
registry, name, &wl_shm_interface, 1);
} else if (strcmp(interface, wl_compositor_interface.name) == 0) {
//if (strcmp(interface, wl_shm_interface.name) == 0) {
// state->wl_shm = wl_registry_bind(
// registry, name, &wl_shm_interface, 1);
//}
if (strcmp(interface, wl_compositor_interface.name) == 0) {
state->wl_compositor = wl_registry_bind(
registry, name, &wl_compositor_interface, 4);
} else if (strcmp(interface, xdg_wm_base_interface.name) == 0) {
}
if (strcmp(interface, xdg_wm_base_interface.name) == 0) {
state->xdg_wm_base = wl_registry_bind(
registry, name, &xdg_wm_base_interface, 1);
xdg_wm_base_add_listener(state->xdg_wm_base,
@ -218,8 +221,10 @@ main(int argc, char *argv[])
xdg_toplevel_set_title(state.xdg_toplevel, "GLONKERS!");
wl_surface_commit(state.wl_surface);
egl_init(&state);
while (wl_display_dispatch(state.wl_display)) {
/* This space deliberately left blank */
eglSwapBuffers(state.egl_display, state.egl_surface);
}
return 0;