mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
examples: convert to new rendering API
Left out multi-pointer (will be removed) and quads (requires arbitrary rotation).
This commit is contained in:
parent
8fe29e6bd1
commit
8e81b4bb42
8 changed files with 149 additions and 76 deletions
|
|
@ -62,14 +62,21 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
sample->dec = inc;
|
||||
}
|
||||
|
||||
wlr_output_attach_render(wlr_output, NULL);
|
||||
struct wlr_output_state state = {0};
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &state, NULL);
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
.color = {
|
||||
.r = sample->color[0],
|
||||
.g = sample->color[1],
|
||||
.b = sample->color[2],
|
||||
.a = sample->color[3],
|
||||
},
|
||||
});
|
||||
wlr_render_pass_submit(pass);
|
||||
|
||||
struct wlr_renderer *renderer = sample->renderer;
|
||||
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
|
||||
wlr_renderer_clear(renderer, sample->color);
|
||||
wlr_renderer_end(renderer);
|
||||
|
||||
wlr_output_commit(wlr_output);
|
||||
wlr_output_commit_state(wlr_output, &state);
|
||||
wlr_output_state_finish(&state);
|
||||
sample->last_frame = now;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue