xil_get_active_buffer(3)
NAME
xil_get_active_buffer, xil_set_active_buffer - get or set the active buffer on a double-buffered device image
SYNOPSIS
#include <xil/xil.h>
XilBufferId xil_get_active_buffer ( XilImage image);
void xil_set_active_buffer ( XilImage image,
XilBufferId id);
DESCRIPTION
The active buffer of a double-buffered device image represents the buffer that will be affected when an operation uses the double-buffered image. At creation of a double-buffered image, the back buffer is the active buffer.
xil_get_active_buffer () returns the current XilBufferId for the active buffer of a double-buffered device image. The XilBufferId is an enumeration type that can be one of the following enumeration constants :
XIL_FRONT_BUFFER
XIL_BACK_BUFFER
If this function is called on an image that is either not a device image or not a double-buffered image, an error is generated and the value XIL_BACK_BUFFER is returned to the user.
xil_set_active_buffer () sets the active buffer for the double-buffered device image to either XIL_FRONT_BUFFER or XIL_BACK_BUFFER. If this function is called on an image that is either not a device image or not a double-buffered device image, an error is generated.
EXAMPLES
XilSystemState State;
XilImage display_image;
XilImage image0, image1;
Display∗ display;
Window window;
/∗ Create an XIL display image from existing X display and window ∗/
if(display_image = xil_create_double_buffered_window(State,
display,window) == NULL) {
/∗ return with error ∗/
}
/∗ We know that this device image is double buffered ∗/
/∗ Copy image0 to the back buffer of display ∗/
xil_copy(image0, display_image);
/∗ Move the back buffers contents to the front buffer ∗/
xil_swap_buffers(display_image);
/∗ Set the active buffer of the display image to the front buffer ∗/
xil_set_active_buffer(display_image, XIL_FRONT_BUFFER);
/∗ overwrite the contents of the front buffer directly ∗/
xil_copy(image1, display_image);
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
NOTES
Changing the active buffer to the XIL_FRONT_BUFFER does not change the fact that xil_swap_buffers(3) swaps the contents of the back buffer to the front buffer.
SEE ALSO
xil_create_double_buffered_window(3), xil_swap_buffers(3).
SunOS 5.6 — Last change: 24 February 1997