#include <screen/screen.h> int screen_create_pixmap( screen_pixmap_t *ppix, screen_context_t ctx );
- An address where the function can store a handle to the native pixmap.
- A connection to screen (acquired with screen_create_context()).
This function creates a pixmap object, which is an off-screen rendering target. Memory is allocated to keep state variables and other information pertaining to the pixmap. The composited windowing system keeps track of pixmaps that are allocated to ensure resources are released when the application terminates. Pixmaps cannot be used for rendering until a buffer has been created with screen_create_pixmap_buffer(). The contents of pixmaps can be updated using various rendering APIs provided the usage flags are set appropriately before creating the pixmap buffer. The results of this rendering can be made visible by copying parts of the pixmap to a window using screen_blit(). Applications should use screen_destroy_pixmap() when a pixmap is no longer used.
If the function succeeds, it returns 0 and a new pixmap is created. Otherwise, the function returns -1 and the errno is set.