GRRLIB/template_2source_2main_8c-example.html

117 lines
7.3 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GRRLIB: template/source/main.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GRRLIB
&#160;<span id="projectnumber">4.4.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">template/source/main.c</div> </div>
</div><!--header-->
<div class="contents">
<p>This example shows the minimum code required to use GRRLIB.It could be used as a template to start a new project. More elaborate examples can be found inside the <em>examples</em> folder.</p>
<div class="fragment"><div class="line"><span class="comment">/*===========================================</span></div>
<div class="line"><span class="comment"> GRRLIB (GX Version)</span></div>
<div class="line"><span class="comment"> - Template Code -</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> Minimum Code To Use GRRLIB</span></div>
<div class="line"><span class="comment">============================================*/</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="grrlib_8h.html">grrlib.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;wiiuse/wpad.h&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv) {</div>
<div class="line"> <span class="comment">// Initialise the Graphics &amp; Video subsystem</span></div>
<div class="line"> <a name="a0"></a><a class="code" href="group___all_func.html#gad3186c7e10e4e6c46a743e062971e89a">GRRLIB_Init</a>();</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Initialise the Wiimotes</span></div>
<div class="line"> WPAD_Init();</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Loop forever</span></div>
<div class="line"> <span class="keywordflow">while</span>(1) {</div>
<div class="line"> </div>
<div class="line"> WPAD_ScanPads(); <span class="comment">// Scan the Wiimotes</span></div>
<div class="line"> </div>
<div class="line"> <span class="comment">// If [HOME] was pressed on the first Wiimote, break out of the loop</span></div>
<div class="line"> <span class="keywordflow">if</span> (WPAD_ButtonsDown(0) &amp; WPAD_BUTTON_HOME) <span class="keywordflow">break</span>;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// ---------------------------------------------------------------------</span></div>
<div class="line"> <span class="comment">// Place your drawing code here</span></div>
<div class="line"> <span class="comment">// ---------------------------------------------------------------------</span></div>
<div class="line"> </div>
<div class="line"> <a name="a1"></a><a class="code" href="group___all_func.html#ga9840a19154f1e0cf9de14ad81ba23aef">GRRLIB_Render</a>(); <span class="comment">// Render the frame buffer to the TV</span></div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <a name="a2"></a><a class="code" href="group___all_func.html#ga15b1f7d9224e25e77d2806847344f651">GRRLIB_Exit</a>(); <span class="comment">// Be a good boy, clear the memory allocated by GRRLIB</span></div>
<div class="line"> </div>
<div class="line"> exit(0); <span class="comment">// Use exit() to exit a program, do not use &#39;return&#39; from main()</span></div>
<div class="line">}</div>
<div class="ttc" id="agroup___all_func_html_ga15b1f7d9224e25e77d2806847344f651"><div class="ttname"><a href="group___all_func.html#ga15b1f7d9224e25e77d2806847344f651">GRRLIB_Exit</a></div><div class="ttdeci">void GRRLIB_Exit(void)</div><div class="ttdoc">Call this before exiting your application.</div><div class="ttdef"><b>Definition:</b> GRRLIB_core.c:223</div></div>
<div class="ttc" id="agroup___all_func_html_ga9840a19154f1e0cf9de14ad81ba23aef"><div class="ttname"><a href="group___all_func.html#ga9840a19154f1e0cf9de14ad81ba23aef">GRRLIB_Render</a></div><div class="ttdeci">void GRRLIB_Render(void)</div><div class="ttdoc">Call this function after drawing.</div><div class="ttdef"><b>Definition:</b> GRRLIB_render.c:407</div></div>
<div class="ttc" id="agroup___all_func_html_gad3186c7e10e4e6c46a743e062971e89a"><div class="ttname"><a href="group___all_func.html#gad3186c7e10e4e6c46a743e062971e89a">GRRLIB_Init</a></div><div class="ttdeci">int GRRLIB_Init(void)</div><div class="ttdoc">Initialize GRRLIB.</div><div class="ttdef"><b>Definition:</b> GRRLIB_core.c:53</div></div>
<div class="ttc" id="agrrlib_8h_html"><div class="ttname"><a href="grrlib_8h.html">grrlib.h</a></div><div class="ttdoc">GRRLIB user include file.</div></div>
</div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>