diff options
author | Simon Ser <contact@emersion.fr> | 2021-11-05 12:26:38 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-11-18 09:37:32 -0500 |
commit | 142d10e591c0f349843f718d87b44c8ba2b33476 (patch) | |
tree | 05f123da396a4cd0b4398dbdbddb0eec38f0d554 /include | |
parent | b5d4bc3c62886f3e089165bd4d82bae781a6bda3 (diff) |
output: add wlr_output_init_render
Co-authored-by: Simon Zeni <simon@bl4ckb0ne.ca>
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_output.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 17f48311..9d3dc3cb 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -182,6 +182,8 @@ struct wlr_output { struct wlr_buffer *cursor_front_buffer; int software_cursor_locks; // number of locks forcing software cursors + struct wlr_allocator *allocator; + struct wlr_renderer *renderer; struct wlr_swapchain *swapchain; struct wlr_buffer *back_buffer, *front_buffer; @@ -257,6 +259,18 @@ void wlr_output_enable(struct wlr_output *output, bool enable); void wlr_output_create_global(struct wlr_output *output); void wlr_output_destroy_global(struct wlr_output *output); /** + * Initialize the output's rendering subsystem with the provided allocator and + * renderer. Can only be called once. + * + * Call this function prior to any call to wlr_output_attach_render, + * wlr_output_commit or wlr_output_cursor_create. + * + * The buffer capabilities of the provided must match the capabilities of the + * output's backend. Returns false otherwise. + */ +bool wlr_output_init_render(struct wlr_output *output, + struct wlr_allocator *allocator, struct wlr_renderer *renderer); +/** * Returns the preferred mode for this output. If the output doesn't support * modes, returns NULL. */ |