diff options
Diffstat (limited to 'doc/html/main_8cpp.html')
-rw-r--r-- | doc/html/main_8cpp.html | 252 |
1 files changed, 252 insertions, 0 deletions
diff --git a/doc/html/main_8cpp.html b/doc/html/main_8cpp.html new file mode 100644 index 0000000..84dd969 --- /dev/null +++ b/doc/html/main_8cpp.html @@ -0,0 +1,252 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.8.10"/> +<title>gamedev: main.cpp File Reference</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> +<script type="text/javascript"> + $(document).ready(function() { init_search(); }); +</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">gamedev + </div> + </td> + </tr> + </tbody> +</table> +</div> +<!-- end header part --> +<!-- Generated by Doxygen 1.8.10 --> +<script type="text/javascript"> +var searchBox = new SearchBox("searchBox", "search",false,'Search'); +</script> + <div id="navrow1" class="tabs"> + <ul class="tablist"> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + <li> + <div id="MSearchBox" class="MSearchBoxInactive"> + <span class="left"> + <img id="MSearchSelect" src="search/mag_sel.png" + onmouseover="return searchBox.OnSearchSelectShow()" + onmouseout="return searchBox.OnSearchSelectHide()" + alt=""/> + <input type="text" id="MSearchField" value="Search" accesskey="S" + onfocus="searchBox.OnSearchFieldFocus(true)" + onblur="searchBox.OnSearchFieldFocus(false)" + onkeyup="searchBox.OnSearchFieldChange(event)"/> + </span><span class="right"> + <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> + </span> + </div> + </li> + </ul> + </div> + <div id="navrow2" class="tabs2"> + <ul class="tablist"> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul> + </div> +<!-- 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><!-- top --> +<div class="header"> + <div class="summary"> +<a href="#define-members">Macros</a> | +<a href="#func-members">Functions</a> | +<a href="#var-members">Variables</a> </div> + <div class="headertitle"> +<div class="title">main.cpp File Reference</div> </div> +</div><!--header--> +<div class="contents"> + +<p>The file that links everything together for the game to run. The main game loop contains all of the global variables the game uses, and it runs the main game loop, the render loop, and the logic loop that control all of the entities. +<a href="#details">More...</a></p> +<div class="textblock"><code>#include <cstdio></code><br /> +<code>#include <chrono></code><br /> +<code>#include <common.h></code><br /> +<code>#include <<a class="el" href="world_8h_source.html">world.h</a>></code><br /> +<code>#include <ui.h></code><br /> +<code>#include <entities.h></code><br /> +</div><table class="memberdecls"> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> +Macros</h2></td></tr> +<tr class="memitem:a4a0c770328891d8916c1142a26481e4a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a0c770328891d8916c1142a26481e4a"></a> +#define </td><td class="memItemRight" valign="bottom"><b>TICKS_PER_SEC</b>   20</td></tr> +<tr class="separator:a4a0c770328891d8916c1142a26481e4a"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a3ac3c588b407d69920af6496f3aaeaf9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3ac3c588b407d69920af6496f3aaeaf9"></a> +#define </td><td class="memItemRight" valign="bottom"><b>MSEC_PER_TICK</b>   (1000/TICKS_PER_SEC)</td></tr> +<tr class="separator:a3ac3c588b407d69920af6496f3aaeaf9"><td class="memSeparator" colspan="2"> </td></tr> +</table><table class="memberdecls"> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> +Functions</h2></td></tr> +<tr class="memitem:af1feec528aef91d55552ce7e325e0f74"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af1feec528aef91d55552ce7e325e0f74"></a> +void </td><td class="memItemRight" valign="bottom"><b>initEverything</b> (void)</td></tr> +<tr class="separator:af1feec528aef91d55552ce7e325e0f74"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a68636a939ce1a8c8736e1671d6f2c921"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a68636a939ce1a8c8736e1671d6f2c921"></a> +void </td><td class="memItemRight" valign="bottom"><b>logic</b> (void)</td></tr> +<tr class="separator:a68636a939ce1a8c8736e1671d6f2c921"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a6765cdcebe5c8445969d5f76345df457"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6765cdcebe5c8445969d5f76345df457"></a> +void </td><td class="memItemRight" valign="bottom"><b>render</b> (void)</td></tr> +<tr class="separator:a6765cdcebe5c8445969d5f76345df457"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a52387bf053883d1a8feeee2dd2cdd4f3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a52387bf053883d1a8feeee2dd2cdd4f3"></a> +void </td><td class="memItemRight" valign="bottom"><b>mainLoop</b> (void)</td></tr> +<tr class="separator:a52387bf053883d1a8feeee2dd2cdd4f3"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a3f4650350f7c52cdb50175e55058c604"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3f4650350f7c52cdb50175e55058c604"></a> +std::string </td><td class="memItemRight" valign="bottom"><b>readFile</b> (const char *filePath)</td></tr> +<tr class="separator:a3f4650350f7c52cdb50175e55058c604"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a941a22cb7e0f6429fe40f91e83ead3d9"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#a941a22cb7e0f6429fe40f91e83ead3d9">millis</a> (void)</td></tr> +<tr class="separator:a941a22cb7e0f6429fe40f91e83ead3d9"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="main_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr> +<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr> +</table><table class="memberdecls"> +<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> +Variables</h2></td></tr> +<tr class="memitem:aaa8e409e04dcf575ef63fd5fb3db06f9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa8e409e04dcf575ef63fd5fb3db06f9"></a> +SDL_Window * </td><td class="memItemRight" valign="bottom"><b>window</b> = NULL</td></tr> +<tr class="separator:aaa8e409e04dcf575ef63fd5fb3db06f9"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a7b5f505ee07aa2fc132a1f04ce33162c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7b5f505ee07aa2fc132a1f04ce33162c"></a> +SDL_GLContext </td><td class="memItemRight" valign="bottom"><b>mainGLContext</b> = NULL</td></tr> +<tr class="separator:a7b5f505ee07aa2fc132a1f04ce33162c"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a9b008924a50085448a0761c7e841acfc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9b008924a50085448a0761c7e841acfc"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>bgDay</b></td></tr> +<tr class="separator:a9b008924a50085448a0761c7e841acfc"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a3837f6d6b1701e98578f3ba0ee9d90e7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3837f6d6b1701e98578f3ba0ee9d90e7"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>bgNight</b></td></tr> +<tr class="separator:a3837f6d6b1701e98578f3ba0ee9d90e7"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:afce018081a460f35ddd04033a081ac83"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afce018081a460f35ddd04033a081ac83"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>bgMtn</b></td></tr> +<tr class="separator:afce018081a460f35ddd04033a081ac83"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a34e3cb52ded6aaf845074c0303a84c33"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a34e3cb52ded6aaf845074c0303a84c33"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>bgTreesFront</b></td></tr> +<tr class="separator:a34e3cb52ded6aaf845074c0303a84c33"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aa36d4c9de8b002fe641f043ecb819656"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa36d4c9de8b002fe641f043ecb819656"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>bgTreesMid</b></td></tr> +<tr class="separator:aa36d4c9de8b002fe641f043ecb819656"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a48a7f2abfb80ba87a38600885fc24904"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a48a7f2abfb80ba87a38600885fc24904"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>bgTreesFar</b></td></tr> +<tr class="separator:a48a7f2abfb80ba87a38600885fc24904"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a2bf73692c7682fcae9cdc62fb1778e9f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2bf73692c7682fcae9cdc62fb1778e9f"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>invUI</b></td></tr> +<tr class="separator:a2bf73692c7682fcae9cdc62fb1778e9f"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aaa52a27abaaf72231a84c99f2bfa4283"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaa52a27abaaf72231a84c99f2bfa4283"></a> +bool </td><td class="memItemRight" valign="bottom"><b>gameRunning</b></td></tr> +<tr class="separator:aaa52a27abaaf72231a84c99f2bfa4283"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:adc1a7b3846cdf41f82a17950d107bfb2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc1a7b3846cdf41f82a17950d107bfb2"></a> +float </td><td class="memItemRight" valign="bottom"><b>handAngle</b></td></tr> +<tr class="separator:adc1a7b3846cdf41f82a17950d107bfb2"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:ab0d5cf0befa2a1b6fd9eed35c5f6eb54"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab0d5cf0befa2a1b6fd9eed35c5f6eb54"></a> +<a class="el" href="classWorld.html">World</a> * </td><td class="memItemRight" valign="bottom"><b>currentWorld</b> =NULL</td></tr> +<tr class="separator:ab0d5cf0befa2a1b6fd9eed35c5f6eb54"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a96781128d3743da3d17e0fdd91afba7b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a96781128d3743da3d17e0fdd91afba7b"></a> +<a class="el" href="classPlayer.html">Player</a> * </td><td class="memItemRight" valign="bottom"><b>player</b></td></tr> +<tr class="separator:a96781128d3743da3d17e0fdd91afba7b"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a8bace7920d06b121b855a75639a7f625"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8bace7920d06b121b855a75639a7f625"></a> +bool </td><td class="memItemRight" valign="bottom"><b>worldInside</b></td></tr> +<tr class="separator:a8bace7920d06b121b855a75639a7f625"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a50403f70d039eb253c1be121d72a9c5a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a50403f70d039eb253c1be121d72a9c5a"></a> +unsigned int </td><td class="memItemRight" valign="bottom"><b>tickCount</b> = 0</td></tr> +<tr class="separator:a50403f70d039eb253c1be121d72a9c5a"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:af54c40bfc9df47f871a2f1988b5698a6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af54c40bfc9df47f871a2f1988b5698a6"></a> +unsigned int </td><td class="memItemRight" valign="bottom"><b>deltaTime</b> = 0</td></tr> +<tr class="separator:af54c40bfc9df47f871a2f1988b5698a6"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a836dcec716beba7d9709b49832064b6a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a836dcec716beba7d9709b49832064b6a"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>fragShader</b></td></tr> +<tr class="separator:a836dcec716beba7d9709b49832064b6a"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a1e91db27f0eca4f48996febd1ec5fd23"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e91db27f0eca4f48996febd1ec5fd23"></a> +GLuint </td><td class="memItemRight" valign="bottom"><b>shaderProgram</b></td></tr> +<tr class="separator:a1e91db27f0eca4f48996febd1ec5fd23"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aa3a0cfcda8346bb1599fb41cda621f16"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa3a0cfcda8346bb1599fb41cda621f16"></a> +FILE * </td><td class="memItemRight" valign="bottom"><b>names</b></td></tr> +<tr class="separator:aa3a0cfcda8346bb1599fb41cda621f16"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:aecf0a8f9c4e7b09fcbcfd911ae015533"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aecf0a8f9c4e7b09fcbcfd911ae015533"></a> +unsigned int </td><td class="memItemRight" valign="bottom"><b>loops</b> = 0</td></tr> +<tr class="separator:aecf0a8f9c4e7b09fcbcfd911ae015533"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a1f883088bca4920bd59729925f82fdcb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1f883088bca4920bd59729925f82fdcb"></a> +<a class="el" href="structvec2.html">vec2</a> </td><td class="memItemRight" valign="bottom"><b>offset</b></td></tr> +<tr class="separator:a1f883088bca4920bd59729925f82fdcb"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a01f16482fbffb67b04283fda27a35b0f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01f16482fbffb67b04283fda27a35b0f"></a> +<a class="el" href="world_8h.html#a7e5783b78992864281462a5380a28924">WEATHER</a> </td><td class="memItemRight" valign="bottom"><b>weather</b></td></tr> +<tr class="separator:a01f16482fbffb67b04283fda27a35b0f"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a4b1577e5b7bc2e8dc302c02dfe2e6526"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4b1577e5b7bc2e8dc302c02dfe2e6526"></a> +bool </td><td class="memItemRight" valign="bottom"><b>fadeEnable</b></td></tr> +<tr class="separator:a4b1577e5b7bc2e8dc302c02dfe2e6526"><td class="memSeparator" colspan="2"> </td></tr> +</table> +<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> +<div class="textblock"><p>The file that links everything together for the game to run. The main game loop contains all of the global variables the game uses, and it runs the main game loop, the render loop, and the logic loop that control all of the entities. </p> +</div><h2 class="groupheader">Function Documentation</h2> +<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int main </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> +<p>(Attempt to) Initialize SDL libraries so that we can use SDL facilities and eventually make openGL calls. Exit if there was an error.</p> +<p>` (Attempt to) Initialize SDL_image libraries with IMG_INIT_PNG so that we can load PNG textures for the entities and stuff.</p> +<p>(Attempt to) Initialize SDL_mixer libraries for loading and playing music/sound files.</p> + +</div> +</div> +<a class="anchor" id="a941a22cb7e0f6429fe40f91e83ead3d9"></a> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">unsigned int millis </td> + <td>(</td> + <td class="paramtype">void </td> + <td class="paramname"></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> +<p>millis</p> +<p>We've encountered many problems when attempting to create delays for triggering the logic function. As a result, we decided on using the timing libraries given by <chrono> in the standard C++ library. This function simply returns the amount of milliseconds that have passed sine the epoch. </p> + +</div> +</div> +</div><!-- contents --> +<!-- start footer part --> +<hr class="footer"/><address class="footer"><small> +Generated by  <a href="http://www.doxygen.org/index.html"> +<img class="footer" src="doxygen.png" alt="doxygen"/> +</a> 1.8.10 +</small></address> +</body> +</html> |