diff --git a/examples/pointer.c b/examples/pointer.c index 399b1de6..a316bce5 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -1,7 +1,6 @@ #define _POSIX_C_SOURCE 200112L #define _XOPEN_SOURCE 500 #include -#include #include #include #include @@ -97,14 +96,14 @@ void output_frame_notify(struct wl_listener *listener, void *data) { struct sample_output *sample_output = wl_container_of(listener, sample_output, frame); struct sample_state *sample = sample_output->sample; struct wlr_output *wlr_output = sample_output->output; + struct wlr_renderer *renderer = wlr_backend_get_renderer(wlr_output->backend); + assert(renderer); wlr_output_make_current(wlr_output, NULL); - - glClearColor(sample->clear_color[0], sample->clear_color[1], - sample->clear_color[2], sample->clear_color[3]); - glClear(GL_COLOR_BUFFER_BIT); - + wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); + wlr_renderer_clear(renderer, sample->clear_color); wlr_output_swap_buffers(wlr_output, NULL, NULL); + wlr_renderer_end(renderer); } static void handle_cursor_motion(struct wl_listener *listener, void *data) {