1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>GXSetDrawSync</title>
10</head>
11
12<body>
13
14<h1 align="left">GXSetDrawSync</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/gx.h&gt;
19
20void GXSetDrawSync( u16 token );
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<TH>token</TH>
27<TD>A 16-bit value for writing to the token register.</TD>
28  </tr>
29</TABLE>
30
31<h2>Return Values</h2>
32<p>None.</p>
33
34<H2>Description</H2>
35<P>This function sends a <SPAN class="argument">token</SPAN> into the command stream. When the <SPAN class="argument">token</SPAN> reaches the end of the graphics pipeline (just before the frame buffer), it is written to a special <SPAN class="argument">token</SPAN> register.&nbsp;You can read out this register using the <A href="GXReadDrawSync.html"><CODE>GXReadDrawSync</CODE></A> function. This allows the application to monitor the completion of graphics rendering tasks.</P>
36<P>When the token register is set, an interrupt is also received by the CPU. Install a callback on this interrupt with <code><a href="GXSetDrawSyncCallback.html">GXSetDrawSyncCallback</a></code>. This will allow you to sample performance counters to profile the elapsed time between events in the graphics pipeline.&nbsp;Rendering synchronization can also be used to notify the CPU that the graphics processor is finished using a shared resource (a vertex array, for example). The <CODE>GXSetDrawSync</CODE> function calls the <A href="../Management/GXFlush.html"><CODE>GXFlush</CODE></A> function. Therefore, there is no need to explicitly call the <A href="../Management/GXFlush.html"><CODE>GXFlush</CODE></A> function after you have set the <SPAN class="argument">token</SPAN> with <CODE>GXSetDrawSync</CODE>.</P>
37
38<h2>See Also</h2>
39<P class="reference">
40<a href="GXReadDrawSync.html">GXReadDrawSync</a>,
41<a href="GXSetDrawSyncCallback.html">GXSetDrawSyncCallback</a>
42</p>
43
44<H2>Revision History</H2>
45<P>
462008/05/12 Mentioned that <CODE>GXFlush</CODE> is included.<br>2006/03/01 Initial version.<br>
47</P>
48
49<hr><p>CONFIDENTIAL</p></body>
50</html>