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>DEMOInit</title>
10</head>
11
12<body>
13
14<h1 align="left">DEMOInit</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20<dd><pre><CODE>#include &lt;demo.h&gt;</CODE></pre>
21  </dd>
22<dd><pre><CODE>void DEMOInit(<A href="../gx/Structures/GXRenderModeObj.html">GXRenderModeObj</A>* mode)</CODE></pre>
23  </dd>
24</dl><h2>Arguments</h2>
25<TABLE border="1" cellpadding="3" cellspacing="0.1">
26  <tr>
27<TD width="120" bgcolor="#ffffe8"><em><strong><CODE>mode</font></strong></em></TD>
28<TD width="520"><A href="../gx/Framebuffer/RenderMode.html">Render mode</A></TD>
29    </tr>
30</TABLE>
31<h2>Return Values</h2>
32
33<p>None.</p>
34<H2>Description</H2>
35<P>The DEMO library provides a common application framework that is used in many of the example demos distributed with the Revolution SDK. The source code for the DEMO library is also distributed with the SDK.</P>
36<P>This function initializes the components of the operating system and  device drivers. The <CODE><EM><STRONG>mode</STRONG></EM></CODE> argument allows the program to overwrite the default render mode. All of the main memory is then allocated into a heap that can be managed with the <a href="../os/Alloc/OSAlloc.html"><code>OSAlloc</code></a> function.</P>
37<P>This function initializes the video controller with a 640x480 interlaced display and a 60 Hz refresh rate.</P>
38<H3>Example Program</H3>
39<P><CODE>#include &lt;demo.h&gt;<BR> #include &lt;math.h&gt;<BR> <BR> void&nbsp; main ( void )<BR> {<BR> &nbsp;&nbsp;&nbsp; // initialize render settings <BR> &nbsp;&nbsp;&nbsp; <A href="DEMOInit.html">DEMOInit</A>(NULL);<BR> <BR> &nbsp;&nbsp;&nbsp; while ( ! ( DemoPadGetButton(0) &amp; PAD_BUTTON_MENU ) )<BR> &nbsp;&nbsp;&nbsp; {<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // get pad status<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DEMOPadRead( );<BR> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Draw scene<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A href="DEMOBeforeRender.html">DEMOBeforeRender</A>( );<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GlobalSceneDraw( &amp;myGlobal );<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A href="DEMODoneRender.html">DEMODoneRender</A>( );<BR> &nbsp;&nbsp;&nbsp; }<BR> <BR> &nbsp;&nbsp;&nbsp; OSHalt(&quot;End of demo&quot;);<BR> }<BR></CODE></P>
40
41
42<h2>See Also</h2>
43
44<p><a href="DEMOBeforeRender.html"><CODE>DEMOBeforeRender</CODE></a><br> <a href="DEMODoneRender.html"><CODE>DEMODoneRender</CODE></a><br> <a href="DEMOSwapBuffers.html"><CODE>DEMOSwapBuffers</CODE></a><br> <a href="DEMOGetRenderModeObj.html"><CODE>DEMOGetRenderModeObj</CODE></a><br> <a href="DEMOGetCurrentBuffer.html"><CODE>DEMOGetCurrentBuffer</CODE></a></p>
45<H2>Revision History</H2>
46<P>03/01/2006 Initial version.</P>
47</body>
48</html>