screen_attach_pixmap_buffer()

Associate an externally allocated buffer with a pixmap.

Synopsis:

#include <screen/screen.h>
 
int screen_attach_pixmap_buffer(screen_pixmap_t pix,
                                screen_buffer_t buf)

Arguments:

pix

The handle of a pixmap that does not already have a buffer created or associated to it.

buf

A buffer that was allocated by the application.

Library:

libscreen

Description:

Function Type: Flushing Execution

This function can be used to force a pixmap to use a buffer that was allocated by the application. Since pixmaps can have only one buffer, it is not possible to call this function or screen_create_pixmap_buffer() more than once. Whoever allocates the buffer is required to meet all alignment and granularity constraints required for the usage flags. The buffer buf must have been created with the function screen_create_buffer(), screen_create_pixmap_buffer(), or screen_create_window_buffers().

Returns:

0 if the buffer was used by the specified pixmap, or -1 if an error occurred (errno is set; refer to /usr/include/errno.h for more details). Note that the error may also have been caused by any delayed execution function that's just been flushed.