aboutsummaryrefslogtreecommitdiff
path: root/example/shared.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-20 15:29:27 -0400
committerDrew DeVault <sir@cmpwn.com>2017-06-20 15:29:27 -0400
commitc9d5a0b2fb5686627344922138c3c603cae364bc (patch)
tree93806ad5b5745eb63c29fe1a7a211571f0038591 /example/shared.c
parent51f35e7af0f7f01381b702b7630763fb9354701a (diff)
Clean up Wayland backend GL context and such
Diffstat (limited to 'example/shared.c')
-rw-r--r--example/shared.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/example/shared.c b/example/shared.c
index be1bdee7..0fe7270f 100644
--- a/example/shared.c
+++ b/example/shared.c
@@ -418,8 +418,6 @@ static void output_remove_notify(struct wl_listener *listener, void *data) {
}
void compositor_init(struct compositor_state *state) {
- memset(state, 0, sizeof(struct compositor_state));
-
state->display = wl_display_create();
state->event_loop = wl_display_get_event_loop(state->display);
state->session = wlr_session_start(state->display);
@@ -457,14 +455,14 @@ void compositor_init(struct compositor_state *state) {
state->backend = wlr;
clock_gettime(CLOCK_MONOTONIC, &state->last_frame);
-}
-void compositor_run(struct compositor_state *state) {
if (!wlr_backend_init(state->backend)) {
fprintf(stderr, "Failed to initialize backend\n");
exit(1);
}
+}
+void compositor_run(struct compositor_state *state) {
while (!state->exit) {
wl_event_loop_dispatch(state->event_loop, 0);
}