#include <screen/screen.h> int screen_create_pixmap_buffer( screen_pixmap_t pix );
- The handle of the pixmap for which a new buffer will be allocated.
Call this function to add a buffer to a pixmap. Pixmaps are restricted to a single buffer. No rendering can be performed onto the pixmap until a buffer has been created or attached. If the buffer size hasn’t been set explicitly, the buffer size will default to the first display’s size. Trying to change the buffer size or the usage once a buffer has already been allocated will result in an error. Additionally, trying to change the pixel format once the buffer has been added will also result in an error, unless the depth is identical, e.g. changing between RGBA8888 and RGBX8888. Also, a buffer cannot be created if a buffer was previously attached using screen_attach_pixmap_buffer().
If the function succeeds, it returns 0 and a new pixmap buffer is created. Otherwise, the function returns -1 and errno is set.