Fix software cursor rendering for tinywl and some examples
Alexander Bakker
5 years ago
99 | 99 |
sample->clear_color[2], sample->clear_color[3]);
|
100 | 100 |
glClear(GL_COLOR_BUFFER_BIT);
|
101 | 101 |
|
|
102 |
wlr_output_render_software_cursors(wlr_output, NULL);
|
102 | 103 |
wlr_output_swap_buffers(wlr_output, NULL, NULL);
|
103 | 104 |
}
|
104 | 105 |
|
100 | 100 |
wlr_output_make_current(wlr_output, NULL);
|
101 | 101 |
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
|
102 | 102 |
wlr_renderer_clear(renderer, state->clear_color);
|
|
103 |
wlr_output_render_software_cursors(wlr_output, NULL);
|
103 | 104 |
wlr_output_swap_buffers(wlr_output, NULL, NULL);
|
104 | 105 |
wlr_renderer_end(renderer);
|
105 | 106 |
}
|
609 | 609 |
render_surface, &rdata);
|
610 | 610 |
}
|
611 | 611 |
|
|
612 |
/* Hardware cursors are rendered by the GPU on a separate plane, and can be
|
|
613 |
* moved around without re-rendering what's beneath them - which is more
|
|
614 |
* efficient. However, not all hardware supports hardware cursors. For this
|
|
615 |
* reason, wlroots provides a software fallback, which we ask it to render
|
|
616 |
* here. wlr_cursor handles configuring hardware vs software cursors for you,
|
|
617 |
* and this function is a no-op when hardware cursors are in use. */
|
|
618 |
wlr_output_render_software_cursors(output->wlr_output, NULL);
|
|
619 |
|
612 | 620 |
/* Conclude rendering and swap the buffers, showing the final frame
|
613 | 621 |
* on-screen. */
|
614 | 622 |
wlr_renderer_end(renderer);
|