rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / xhtml / glXSwapBuffers.xml
CommitLineData
7faf1d71
AW
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
2<!-- saved from url=(0013)about:internet -->
3<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glXSwapBuffers</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glXSwapBuffers"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glXSwapBuffers — exchange front and back buffers</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glXSwapBuffers</b>(</code></td><td>Display *  </td><td><var class="pdparam">dpy</var>, </td></tr><tr><td> </td><td>GLXDrawable  </td><td><var class="pdparam">drawable</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>dpy</code></em></span></dt><dd><p>
4 Specifies the connection to the X server.
5 </p></dd><dt><span class="term"><em class="parameter"><code>drawable</code></em></span></dt><dd><p>
6 Specifies the drawable whose buffers are to be swapped.
7 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
8 <code class="function">glXSwapBuffers</code> promotes the contents of the back buffer of <em class="parameter"><code>drawable</code></em> to become
9 the contents of the front buffer of <em class="parameter"><code>drawable</code></em>.
10 The contents of the back buffer then become undefined.
11 The update typically takes place during the vertical retrace of
12 the monitor,
13 rather than immediately after <code class="function">glXSwapBuffers</code> is called.
14 </p><p>
15 <code class="function">glXSwapBuffers</code> performs an implicit <a class="citerefentry" href="glFlush.xml"><span class="citerefentry"><span class="refentrytitle">glFlush</span></span></a> before it returns.
16 Subsequent OpenGL commands may be issued immediately after calling <code class="function">glXSwapBuffers</code>,
17 but are not executed until the buffer exchange is completed.
18 </p><p>
19 If <em class="parameter"><code>drawable</code></em> was not created with respect to a double-buffered visual,
20 <code class="function">glXSwapBuffers</code> has no effect,
21 and no error is generated.
22 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
23 The contents of the back buffer become undefined after
24 a swap. Note that this applies to pixel buffers as well as windows.
25 </p><p>
26 All GLX rendering contexts share the same notion of which are front buffers
27 and which are back buffers.
28 One consequence is that when multiple clients are rendering to the same
29 double-buffered window,
30 all of them should finish rendering before one of them issues the command
31 to swap buffers.
32 The clients are responsible for implementing this synchronization.
33 Typically this is accomplished by executing <a class="citerefentry" href="glFinish.xml"><span class="citerefentry"><span class="refentrytitle">glFinish</span></span></a> and then
34 using a semaphore in shared memory to rendezvous before swapping.
35 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
36 <code class="constant">GLXBadDrawable</code> is generated if <em class="parameter"><code>drawable</code></em> is not a valid GLX drawable.
37 </p><p>
38 <code class="constant">GLXBadCurrentWindow</code> is generated if <em class="parameter"><code>dpy</code></em> and <em class="parameter"><code>drawable</code></em> are
39 respectively the display and drawable associated with the current
40 context of the calling thread, and <em class="parameter"><code>drawable</code></em> identifies a window that
41 is no longer valid.
42 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
43 <a class="citerefentry" href="glFlush.xml"><span class="citerefentry"><span class="refentrytitle">glFlush</span></span></a>
44 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
45 Copyright <span class="trademark"></span>© 1991-2006
46 Silicon Graphics, Inc. This document is licensed under the SGI
47 Free Software B License. For details, see
48 <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
49 </p></div></div></body></html>