screen_dequeue_stream_render_buffer()

Graphics and Screen4.0 (8.x)Screen Graphics Subsystem Developer's GuideAPIProgrammingUtilities

Acquire the next available render buffer

Synopsis:

#include <screen/screen.h>
int screen_dequeue_stream_render_buffer(screen_buffer_t *pbuf,
                                        screen_stream_t stream,
                                        int flags)

Arguments:

pbuf
A pointer to a location where this function will store a reference to the render buffer it finds.
stream
The handle of a stream from which a render buffer is to be obtained.
flags
The indication of how you want this function to behave. This integer is a bitmask that represents the combination of Screen flushing types:
  • SCREEN_DONT_BLOCK: When you use SCREEN_DONT_BLOCK, this function returns immediately regardless of whether a render buffer is currently available. If there are no buffers available, the function returns with an EWOULDBLOCK error.

Library:

libscreen

Description:

Function Type: Immediate Execution

This function should be used instead of SCREEN_PROPERTY_RENDER_BUFFERS when screen_post_stream() is called with the SCREEN_DONT_BLOCK flag. SCREEN_PROPERTY_RENDER_BUFFERS is not updated when screen_post_stream() is called with the SCREEN_DONT_BLOCK flag. This function takes a buffer from the render buffers. The buffer will not be available as a render buffer again until one of the following occurs for the buffer:
  1. The producer calls screen_post_stream() with the SCREEN_EXPLICIT_ENQUEUE flag, the producer calls screen_enqueue_render_buffer() and all consumers call screen_release_buffer().
  2. The producer calls screen_post_stream() without the SCREEN_EXPLICIT_ENQUEUE flag and all consumers call screen_release_buffer.
  3. The producer does NOT call screen_post_stream(). Instead, the producer simply calls screen_enqueue_render_buffer().

Returns:

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

Page updated: