1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../css/manpage.css" type="text/css" />
7<title>nngxSwapBuffersByAddress</title>
8  </head>
9  <body>
10<h1><CODE>nngxSwapBuffersByAddress</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14NNGX_APICALL void NNGX_APIENTRY nngxSwapBuffersByAddress(
15     GLenum display,
16     const GLvoid * addr,
17     const GLvoid * addrB,
18     GLsizei width,
19     GLenum format
20);
21</pre>
22    </div>
23<h2>Arguments</h2>
24    <div class="section">
25      <table class="arguments">
26        <thead>
27          <tr>
28            <td width="15" />
29<th>Name</th>
30<td>Description</td>
31          </tr>
32        </thead>
33        <tr>
34<td>in</td>
35<th>display</th>
36<td>Display to show.</td>
37        </tr>
38        <tr>
39<td>in</td>
40<th>addr</th>
41<td>The starting address of the buffer to display.</td>
42        </tr>
43        <tr>
44<td>in</td>
45<th>addrB</th>
46<td>The starting address of the buffer to display for the right eye when stereoscopic display is enabled.</td>
47        </tr>
48        <tr>
49<td>in</td>
50<th>width</th>
51<td>The number of pixels for the width of the display buffer.</td>
52        </tr>
53        <tr>
54<td>in</td>
55<th>format</th>
56<td>The format of the display buffer.</td>
57        </tr> </table>
58    </div>
59<h2>Return Values</h2>
60<div class="section">No values are returned. </div>
61<h2>Description</h2>
62    <div class="section">
63<p>Presets the specified buffer for the display specified by <SPAN class="Argument">display</SPAN>.</p><P>
64This 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.
65            </P><P>
66When <CODE>NN_GX_DISPLAY0</CODE> is specified for <SPAN class="Argument">display</SPAN>, the upper screen is swapped, and when <CODE>NN_GX_DISPLAY1</CODE> is specified, the lower screen is swapped.
67            </P><P>
68The starting address of the buffer to display is specified in <SPAN class="Argument">addr</SPAN>. When stereoscopic display is enabled (when the display mode is <CODE>NN_GX_DISPLAYMODE_STEREO</CODE>), it is the address of the image to be displayed for the left eye. <SPAN class="Argument">addr</SPAN> must be 16-byte aligned.
69            </P><P>
70The starting address of the buffer to be displayed for the right eye is specified in <SPAN class="Argument">addrB</SPAN> when stereoscopic display is enabled. <SPAN class="Argument">addrB</SPAN> is only enabled for the upper screen. When stereoscopic display is disabled, or when <CODE>NN_GX_DISPLAY1</CODE> is specified for <SPAN class="Argument">display</SPAN>, <SPAN class="Argument">addrB</SPAN> is ignored. <SPAN class="Argument">addrB</SPAN> must be 16-byte aligned.
71            </P><P>
72In <CODE>Development</CODE> and <CODE>Debug</CODE> builds, an assert is issued if the <SPAN class="argument">addr</SPAN> or <SPAN class="argument">addrB</SPAN> occupies any portion of the last 1.5MB of VRAM-A or VRAM-B memory.
73            </P><P>
74The number of pixels for the width of the display buffer is specified in <SPAN class="Argument">width</SPAN>. <SPAN class="Argument">width</SPAN> 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). <SPAN class="Argument">width</SPAN> must be a multiple of 8 and a value of at least 240 pixels.
75            </P><P>
76Specifies the format of the display buffer in <SPAN class="Argument">format</SPAN>. Specify one of the following.
77<TABLE><TR><TH><CODE>GL_RGB8_OES</CODE></TH><TD>RGB8 (24-bit)</TD></TR><TR><TH><CODE>GL_RGBA4</CODE></TH><TD>RGBA4 (16-bit)</TD></TR><TR><TH><CODE>GL_RGB5_A1</CODE></TH><TD>RGB5A1 (16-bit)</TD></TR><TR><TH><CODE>GL_RGB565</CODE></TH><TD>RGB565 (16-bit)</TD></TR></TABLE></P><P>
78The display of the buffer resulting from this function is not affected by the display area specified by the settings of the <CODE>nngxDisplayEnv</CODE> function. Specify addresses for <SPAN class="Argument">addr</SPAN> and <SPAN class="Argument">addrB</SPAN> that consider their offsets and so on.
79            </P><P>
80The following errors occur in this function.
81<TABLE><TR><TH><CODE>GL_ERROR_8087_DMP</CODE></TH><TD>An invalid value was specified in<CODE>display</CODE>.</TD></TR><TR><TH><CODE>GL_ERROR_8088_DMP</CODE></TH><TD>The alignment for <SPAN class="Argument">addr</SPAN> was invalid.</TD></TR><TR><TH><CODE>GL_ERROR_8089_DMP</CODE></TH><TD>The alignment for <SPAN class="Argument">addrB</SPAN> was invalid.</TD></TR><TR><TH><CODE>GL_ERROR_808A_DMP</CODE></TH><TD>An invalid value was specified for <SPAN class="Argument">width</SPAN>.</TD></TR><TR><TH><CODE>GL_ERROR_808B_DMP</CODE></TH><TD>An invalid value was specified for <SPAN class="Argument">format</SPAN>.</TD></TR></TABLE></P></div>
82<h2>See Also</h2>
83    <div class="section">
84<p class="reference"><a href="../nn_gx/nngxSwapBuffers.html"><CODE>nngxSwapBuffers</CODE></a><br /> </p>
85    </div>
86<h2>Revision History</h2>
87    <div class="section">
88      <dl class="history">
89        <dt>2011/10/04</dt>
90<dd>Added <B>See Also</B> section.<br />
91        </dd>
92        <dt>2011/07/04</dt>
93<dd>Added information about restrictions on <CODE>addr</CODE> and <CODE>addrB</CODE>.<BR>
94        </dd>
95        <dt>2011/02/01</dt>
96<dd>Initial version.<br />
97        </dd>
98      </dl>
99    </div>
100  <hr><p>CONFIDENTIAL</p></body>
101</html>