nngxSwapBuffersByAddress Function

Syntax

NNGX_APICALL void NNGX_APIENTRY nngxSwapBuffersByAddress(
     GLenum display,
     const GLvoid * addr,
     const GLvoid * addrB,
     GLsizei width,
     GLenum format
);

Parameters

Name Description
in display Display to show.
in addr The starting address of the buffer to display.
in addrB The starting address of the buffer to display for the right eye when stereoscopic display is enabled.
in width The number of pixels for the width of the display buffer.
in format The format of the display buffer.

Return Values

No values are returned.

Description

Presets the specified buffer for the display specified by display.

This function can be called at any time, and at the first V-Sync after this function has been called, content in the specified address is displayed. If this function is called multiple times before V-Sync occurs, it is the last call that is applied to each screen.

When NN_GX_DISPLAY0 is specified for display, the upper screen is swapped, and when NN_GX_DISPLAY1 is specified, the lower screen is swapped.

The starting address of the buffer to display is specified in addr. When stereoscopic display is enabled (when the display mode is NN_GX_DISPLAYMODE_STEREO), it is the address of the image to be displayed for the left eye. addr must be 16-byte aligned.

The starting address of the buffer to be displayed for the right eye is specified in addrB when stereoscopic display is enabled. addrB is only enabled for the upper screen. When stereoscopic display is disabled, or when NN_GX_DISPLAY1 is specified for display, addrB is ignored. addrB must be 16-byte aligned.

In Development and Debug builds, an assert is issued if the addr or addrB occupies any portion of the last 1.5MB of VRAM-A or VRAM-B memory.

The number of pixels for the width of the display buffer is specified in width. width is not the size of the width of the LCD, it is the size of the width of the display buffer. The width in pixels for both the upper and lower LCD screens is 240. When you are displaying only a portion of a display buffer that is wider than 240 pixels, however, set the width to equal the number of pixels for the entire display buffer width (include the portions that won't be displayed). width must be a multiple of 8 and a value of at least 240 pixels.

Specifies the format of the display buffer in format. Specify one of the following.

GL_RGB8_OESRGB8 (24-bit)
GL_RGBA4RGBA4 (16-bit)
GL_RGB5_A1RGB5A1 (16-bit)
GL_RGB565RGB565 (16-bit)

The display of the buffer resulting from this function is not affected by the display area specified by the settings of the nngxDisplayEnv function. Specify addresses for addr and addrB that consider their offsets and so on.

The following errors occur in this function.

GL_ERROR_8087_DMPAn invalid value was specified indisplay.
GL_ERROR_8088_DMPThe alignment for addr was invalid.
GL_ERROR_8089_DMPThe alignment for addrB was invalid.
GL_ERROR_808A_DMPAn invalid value was specified for width.
GL_ERROR_808B_DMPAn invalid value was specified for format.

See Also

nngxSwapBuffers

Revision History

2011/10/04
Added See Also section.
2011/07/04
Added information about restrictions on addr and addrB.
2011/02/01
Initial version.

CONFIDENTIAL