screen_create_window_buffers()

Allocate new buffers for a window

Synopsis:

#include <screen/screen.h>
int screen_create_window_buffers(screen_window_t win,
                                 int count)

Arguments:

win
The handle of the window for which the new buffers must be allocated.
count
The number of buffers to be created for this window. If count is 0 the window is considered bufferless and will display the color specified by SCREEN_PROPERTY_COLOR.

Library:

libscreen

Description:

Function Type: Flushing Execution

This function allocates buffers for a window. Buffers are created with the size of SCREEN_PROPERTY_BUFFER_SIZE as set for the window.

Before calling this function, ensure that you set the SCREEN_PROPERTY_USAGE property on the window to indicate your intended usage of the window's buffer(s). For example, to retrieve SCREEN_PROPERTY_POINTER from the buffer(s), you must have set the SCREEN_PROPERTY_USAGE property to include the SCREEN_USAGE_READ and/or SCREEN_USAGE_WRITE flags on the window prior to calling screen_create_window_buffers().

Returns:

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