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 3.0">
7<meta http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>VIGetRetraceCount</title>
10</head>
11
12<body>
13
14<h1 align="left">VIGetRetraceCount</h1>
15
16<h2>C Specification</h2>
17
18<dl>
19<dd><pre><code>#include &lt;revolution/vi.h&gt;</code></pre>
20  </dd>
21<dd><pre><code>u32 VIGetRetraceCount(void)</code></pre>
22  </dd>
23</dl>
24
25<h2>Arguments</h2>
26
27<p>None.</p>
28
29<h2>Return Values</h2>
30
31<p>The number of retrace interrupts.</p>
32
33<h2>Description</h2>
34
35<p>This function returns how many retrace interrupts have occurred since the <a href="VIInit.html"><code>VIInit</code></a> function was called.</p>
36
37<h2>Sample Code</h2>
38
39<p>The following code shows how to achieve 30Hz rendering using this function:</p>
40
41<pre><code>
42	VIWaitForRetrace(); // Just to make sure the first frame starts
43			    // from the very beginning of the field.
44	while(1) {
45		count = VIGetRetraceCount();
46
47		// rendering
48
49		while (VIGetRetraceCount() == count)
50			;
51
52		VISetNextFrameBuffer(nextbuffer);
53		VIFlush();
54		VIWaitForRetrace();
55	}</code>
56</pre>
57
58<h2>See Also</h2>
59
60<p><a href="VIInit.html"><code>VIInit</code></a></p>
61
62<h2>Revision History</h2>
63
64<P>2006/03/01 Initial version.</p>
65<hr>
66<P>CONFIDENTIAL</p>
67</BODY>
68</HTML>
69