Make window content updates visible on the display
#include <screen/screen.h>
int screen_post_window(screen_window_t win, screen_buffer_t buf, int count, const int *dirty_rects, int flags)
Function Type: Apply Execution
This function makes some pixels in a rendering buffer visible. The pixels to be posted are defined by the dirty rectangles contained in the dirty_rects argument. Note that a window will not be made visible until screen_post_window() has been called at least once.
In addition to the area(s) defined by dirty_rects, Screen may update the other pixels in the buffer (i.e., Screen posts entire buffers, using dirty_rects as a guide). Therefore, your application must ensure that the entire contents of a window buffer is suitable for display at all times.
The use of multiple threads or application buffer management schemes to render at the full display frame rate aren't necessary because unlike equivalent calls in other graphics systems, screen_post_window() doesn't always block.
This function may cause the SCREEN_PROPERTY_RENDER_BUFFERS property of the posting window to change. At any time, only one thread must operate on, or render, to this window. If your application uses multiple threads, you must ensure that access to this window's handle by these threads is guarded. If not, SCREEN_PROPERTY_RENDER_BUFFERS may reflect out-of-date information that can lead to animation artifacts. The presentation of new content may result in a copy or a buffer flip, depending on how the composited windowing system chooses to perform the operation. Use the window property SCREEN_PROPERTY_RENDER_BUFFER_COUNT to determine the number of buffers you have that are available for rendering.
0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).