screen_create_pixmap()

Create a pixmap that can be used to do off-screen rendering. The results of this rendering can later be copied to a window object.

Function type:

Immediate execution

Synopsis:

#include <screen/screen.h>

int screen_create_pixmap( screen_pixmap_t *ppix, 
                          screen_context_t ctx );

Arguments:

ppix
An address where the function can store a handle to the native pixmap.
ctx
A connection to screen (acquired with screen_create_context()).

Library:

screen

Description:

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.

Returns:

If the function succeeds, it returns 0 and a new pixmap is created. Otherwise, the function returns -1 and the errno is set.

Classification:

Windowing API

Safety  Value  
Interrupt handler No
Signal handler No
Thread Yes