screen_ref_pixmap()

Updated: April 19, 2023

Create a reference to a pixmap

Synopsis:

#include <screen/screen.h>
int screen_ref_pixmap(screen_pixmap_t pix)

Arguments:

pix
The handle of the pixmap for which the reference is to be created.

Library:

libscreen

Description:

Function Type: Immediate Execution

This function creates a reference to a pixmap. This function can be used by libraries to prevent the pixmap or its buffer from disappearing while the library is making use of it. The pixmap and its buffer will not be destroyed until all references have been cleared with screen_unref_pixmap(). In the event that a pixmap is destroyed before the reference is cleared, screen_unref_pixmap() will cause the pixmap buffer and/or the pixmap to be destroyed.

Returns:

0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).