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 <revolution/vi.h></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<blockquote> 42<code><p>VIWaitForRetrace(); // just to make sure the first frame starts<br> // from the very beginning of the field.<br> while(1) {<br> count = VIGetRetraceCount();<br> <br> // rendering<br> <br> while (VIGetRetraceCount() == count)<br> ;<br> <br> VISetNextFrameBuffer(nextbuffer);<br> VIFlush();<br> VIWaitForRetrace();<br> }</code></p> 43</blockquote> 44 45<h2>See Also</h2> 46 47<p><a href="VIInit.html"><code>VIInit</code></a></p> 48 49<h2>Revision History</h2> 50 51<P>03/01/2006 Initial version.</p> 52</body> 53</html> 54