aboutsummaryrefslogtreecommitdiff
path: root/main.c
blob: 025bf7a66f7556e4340974b16f0ab3c733e64141 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <EGL/egl.h>
#include <stdio.h>

#include "state.h"
#include "wayland.h"
#include "graphics.h"

int main() {
	client_state state = {0};
	state.running = true;

	state.display = wl_display_connect(NULL);
	if (!state.display) {
		fprintf(stderr, "Failed to Connect to wayland display\n");
		return 0;
	}

	setup_registry(&state);
	setup_surface(&state);

	if (!init_gl(&state)) {
		fprintf(stderr, "Failed to Initalize EGL/OpenGL\n");
		return 1;
	}

	while (state.running) {
		wl_display_dispatch_pending(state.display);
		render_frame(&state);
	}
}