allocation of wayland state memory in main

This commit is contained in:
Rakarake 2025-12-24 17:33:17 +01:00
parent 92ce71b5f1
commit 09ac1a0559
3 changed files with 19 additions and 20 deletions

View file

@ -5,7 +5,6 @@
#include <stdint.h>
#include <wayland-client.h>
#include <wayland-util.h>
#include <SDL3/SDL.h>
#include <pthread.h>
#include <sys/mman.h>
#include "renderer.h"
@ -36,13 +35,14 @@ int main(int argc, char *argv[]) {
exit(1);
}
struct client_state state = wayland_init();
struct client_state state;
wayland_init(&state);
Renderer renderer = new_renderer();
while (running) {
double time = time_since_start();
render(&renderer, state.width, state.height, time, shader_path, false);
render(&renderer, state.width, state.height, time, shader_path, 0);
commit(&state);
}