#include <screen/screen.h> int screen_create_buffer( screen_buffer_t *pbuf );
- An address where the function can store a handle for the native buffer.
This function creates a buffer object, which describes memory where pixels can be drawn to or read from. Memory is allocated to store all information pertaining to a buffer, but not for the buffer itself. Most buffers are created by the composited windowing system through calls to screen_create_window_buffers() and screen_create_pixmap_buffer(). In this case, it is not necessary to create buffer objects with screen_create_buffer(). They can be queried with screen_get_window_property() or screen_get_pixmap_property(). This call is used when buffers must be attached to windows or pixmaps. Applications should use screen_destroy_buffer() when a buffer is no longer used.
If the function succeeds, it returns 0 and a new buffer is created. Otherwise, the function returns -1 and errno is set.