PVRShell_8h-source.html 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  3. <title>PowerVR SDK</title>
  4. <link href="doxygen.css" rel="stylesheet" type="text/css">
  5. <link href="tabs.css" rel="stylesheet" type="text/css">
  6. <table width="100%">
  7. <tr>
  8. <td width="33%">
  9. <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
  10. </td>
  11. <td width="33%">
  12. <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
  13. </td>
  14. <td width="34%">
  15. <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
  16. </td>
  17. </tr>
  18. </table>
  19. <hr>
  20. </head><body>
  21. <!-- Generated by Doxygen 1.3.6 -->
  22. <div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
  23. <h1>PVRShell.h</h1><a href="PVRShell_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
  24. 00002 <span class="comment"></span>
  25. 00003 <span class="comment"> @File PVRShell.h</span>
  26. 00004 <span class="comment"></span>
  27. 00005 <span class="comment"> @Title PVRShell</span>
  28. 00006 <span class="comment"></span>
  29. 00007 <span class="comment"> @Version </span>
  30. 00008 <span class="comment"></span>
  31. 00009 <span class="comment"> @Copyright Copyright (C) Imagination Technologies Limited.</span>
  32. 00010 <span class="comment"></span>
  33. 00011 <span class="comment"> @Platform Independent</span>
  34. 00012 <span class="comment"></span>
  35. 00013 <span class="comment"> @Description Makes programming for 3D APIs easier by wrapping surface</span>
  36. 00014 <span class="comment"> initialization, Texture allocation and other functions for use by a demo.</span>
  37. 00015 <span class="comment"></span>
  38. 00016 <span class="comment">******************************************************************************/</span>
  39. 00017
  40. 00018 <span class="preprocessor">#ifndef __PVRSHELL_H_</span>
  41. 00019 <span class="preprocessor"></span><span class="preprocessor">#define __PVRSHELL_H_</span>
  42. 00020 <span class="preprocessor"></span>
  43. 00021 <span class="comment">/*****************************************************************************/</span>
  44. 00188 <span class="comment">// Uncomment to enable the -fps command-line option</span>
  45. 00189 <span class="comment">// #define PVRSHELL_FPS_OUTPUT</span>
  46. 00190
  47. 00191 <span class="comment">/*****************************************************************************</span>
  48. 00192 <span class="comment">** Includes</span>
  49. 00193 <span class="comment">*****************************************************************************/</span>
  50. 00194 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
  51. 00195
  52. 00196 <span class="preprocessor">#define EXIT_NOERR_CODE 0</span>
  53. 00197 <span class="preprocessor"></span><span class="preprocessor">#define EXIT_ERR_CODE (!EXIT_NOERR_CODE)</span>
  54. 00198 <span class="preprocessor"></span>
  55. 00199 <span class="comment">// avoid warning about unused parameter</span>
  56. <a name="l00200"></a><a class="code" href="PVRShell_8h.html#a0">00200</a> <span class="preprocessor">#define PVRSHELL_UNREFERENCED_PARAMETER(x) ((void) x)</span>
  57. <a name="l00201"></a><a class="code" href="PVRShell_8h.html#a1">00201</a> <span class="preprocessor"></span><span class="comment">/*!***********************************************************************</span>
  58. 00202 <span class="comment"> * Keyboard mapping.</span>
  59. 00203 <span class="comment"> ************************************************************************/</span>
  60. <a name="l00204"></a><a class="code" href="PVRShell_8h.html#a2">00204</a> <span class="keyword">enum</span> <a class="code" href="PVRShell_8h.html#a72">PVRShellKeyName</a>
  61. 00205 {
  62. 00206 <a class="code" href="PVRShell_8h.html#a72a3">PVRShellKeyNameNull</a>,
  63. 00207 <a class="code" href="PVRShell_8h.html#a72a4">PVRShellKeyNameQUIT</a>,
  64. <a name="l00208"></a><a class="code" href="PVRShell_8h.html#a72">00208</a> <a class="code" href="PVRShell_8h.html#a72a5">PVRShellKeyNameSELECT</a>,
  65. 00209 <a class="code" href="PVRShell_8h.html#a72a6">PVRShellKeyNameACTION1</a>,
  66. 00210 <a class="code" href="PVRShell_8h.html#a72a7">PVRShellKeyNameACTION2</a>,
  67. 00211 <a class="code" href="PVRShell_8h.html#a72a8">PVRShellKeyNameUP</a>,
  68. 00212 <a class="code" href="PVRShell_8h.html#a72a9">PVRShellKeyNameDOWN</a>,
  69. 00213 <a class="code" href="PVRShell_8h.html#a72a10">PVRShellKeyNameLEFT</a>,
  70. 00214 <a class="code" href="PVRShell_8h.html#a72a11">PVRShellKeyNameRIGHT</a>,
  71. 00215 <a class="code" href="PVRShell_8h.html#a72a12">PVRShellKeyNameScreenshot</a>
  72. 00216 };
  73. 00217
  74. 00218 <span class="keyword">enum</span> <a class="code" href="PVRShell_8h.html#a73">PVRShellKeyRotate</a>
  75. 00219 {
  76. 00220 <a class="code" href="PVRShell_8h.html#a73a13">PVRShellKeyRotateNone</a>=0,
  77. 00221 <a class="code" href="PVRShell_8h.html#a73a14">PVRShellKeyRotate90</a>,
  78. <a name="l00222"></a><a class="code" href="PVRShell_8h.html#a73">00222</a> <a class="code" href="PVRShell_8h.html#a73a15">PVRShellKeyRotate180</a>,
  79. 00223 <a class="code" href="PVRShell_8h.html#a73a16">PVRShellKeyRotate270</a>
  80. 00224 };
  81. 00225
  82. 00226 <span class="comment">/*!***********************************************************************</span>
  83. 00227 <span class="comment"> * Pointer button mapping.</span>
  84. 00228 <span class="comment"> ************************************************************************/</span>
  85. 00229 <span class="keyword">enum</span> <a class="code" href="PVRShell_8h.html#a74">EPVRShellButtonState</a>
  86. 00230 {
  87. 00231 <a class="code" href="PVRShell_8h.html#a74a17">ePVRShellButtonLeft</a> = 0x1,
  88. 00232 <a class="code" href="PVRShell_8h.html#a74a18">ePVRShellButtonRight</a> = 0x2,
  89. <a name="l00233"></a><a class="code" href="PVRShell_8h.html#a74">00233</a> <a class="code" href="PVRShell_8h.html#a74a19">ePVRShellButtonMiddle</a> = 0x4
  90. 00234 };
  91. 00235
  92. 00236 <span class="comment">/*!***********************************************************************</span>
  93. 00237 <span class="comment"> * @Enum prefNameBoolEnum</span>
  94. 00238 <span class="comment"> * @Brief Boolean Shell preferences.</span>
  95. 00239 <span class="comment"> ************************************************************************/</span>
  96. 00240 <span class="keyword">enum</span> <a class="code" href="PVRShell_8h.html#a75">prefNameBoolEnum</a>
  97. 00241 {
  98. 00242 <a class="code" href="PVRShell_8h.html#a75a20">prefFullScreen</a>,
  99. 00243 <a class="code" href="PVRShell_8h.html#a75a21">prefIsRotated</a>,
  100. <a name="l00244"></a><a class="code" href="PVRShell_8h.html#a75">00244</a> <a class="code" href="PVRShell_8h.html#a75a22">prefPBufferContext</a>,
  101. 00245 <a class="code" href="PVRShell_8h.html#a75a23">prefPixmapContext</a>,
  102. 00246 <a class="code" href="PVRShell_8h.html#a75a24">prefPixmapDisableCopy</a>,
  103. 00247 <a class="code" href="PVRShell_8h.html#a75a25">prefZbufferContext</a>,
  104. 00248 <a class="code" href="PVRShell_8h.html#a75a26">prefLockableBackBuffer</a>,
  105. 00249 <a class="code" href="PVRShell_8h.html#a75a27">prefSoftwareRendering</a>,
  106. 00250 <a class="code" href="PVRShell_8h.html#a75a28">prefStencilBufferContext</a>,
  107. 00251 <a class="code" href="PVRShell_8h.html#a75a29">prefOpenVGContext</a>,
  108. 00252 <a class="code" href="PVRShell_8h.html#a75a30">prefAlphaFormatPre</a>,
  109. 00253 <a class="code" href="PVRShell_8h.html#a75a31">prefPowerSaving</a>,
  110. 00254 <span class="preprocessor">#ifdef PVRSHELL_FPS_OUTPUT</span>
  111. 00255 <span class="preprocessor"></span> prefOutputFPS,
  112. 00256 <span class="preprocessor">#endif</span>
  113. 00257 <span class="preprocessor"></span> <a class="code" href="PVRShell_8h.html#a75a32">prefOutputInfo</a>,
  114. 00258 <a class="code" href="PVRShell_8h.html#a75a33">prefNoShellSwapBuffer</a>
  115. 00259 };
  116. 00260
  117. 00261 <span class="comment">/*!***********************************************************************</span>
  118. 00262 <span class="comment"> * @Enum prefNameFloatEnum</span>
  119. 00263 <span class="comment"> * @Brief Float Shell preferences.</span>
  120. 00264 <span class="comment"> ************************************************************************/</span>
  121. 00265 <span class="keyword">enum</span> <a class="code" href="PVRShell_8h.html#a76">prefNameFloatEnum</a>
  122. 00266 {
  123. 00267 <a class="code" href="PVRShell_8h.html#a76a34">prefQuitAfterTime</a>
  124. 00268 };
  125. <a name="l00269"></a><a class="code" href="PVRShell_8h.html#a76">00269</a>
  126. 00270 <span class="comment">/*!***********************************************************************</span>
  127. 00271 <span class="comment"> * @Enum prefNameIntEnum</span>
  128. 00272 <span class="comment"> * @Brief Integer Shell preferences.</span>
  129. 00273 <span class="comment"> ************************************************************************/</span>
  130. 00274 <span class="keyword">enum</span> <a class="code" href="PVRShell_8h.html#a77">prefNameIntEnum</a>
  131. 00275 {
  132. 00276 <a class="code" href="PVRShell_8h.html#a77a35">prefEGLMajorVersion</a>,
  133. 00277 <a class="code" href="PVRShell_8h.html#a77a36">prefEGLMinorVersion</a>,
  134. <a name="l00278"></a><a class="code" href="PVRShell_8h.html#a77">00278</a> <a class="code" href="PVRShell_8h.html#a77a37">prefWidth</a>,
  135. 00279 <a class="code" href="PVRShell_8h.html#a77a38">prefHeight</a>,
  136. 00280 <a class="code" href="PVRShell_8h.html#a77a39">prefPositionX</a>,
  137. 00281 <a class="code" href="PVRShell_8h.html#a77a40">prefPositionY</a>,
  138. 00282 <a class="code" href="PVRShell_8h.html#a77a41">prefQuitAfterFrame</a>,
  139. 00283 <a class="code" href="PVRShell_8h.html#a77a42">prefSwapInterval</a>,
  140. 00284 <a class="code" href="PVRShell_8h.html#a77a43">prefInitRepeats</a>,
  141. 00285 <a class="code" href="PVRShell_8h.html#a77a44">prefFSAAMode</a>,
  142. 00286 <a class="code" href="PVRShell_8h.html#a77a45">prefCommandLineOptNum</a>,
  143. 00287 <a class="code" href="PVRShell_8h.html#a77a46">prefColorBPP</a>,
  144. 00288 <a class="code" href="PVRShell_8h.html#a77a47">prefDepthBPP</a>,
  145. 00289 <a class="code" href="PVRShell_8h.html#a77a48">prefRotateKeys</a>,
  146. 00290 <a class="code" href="PVRShell_8h.html#a77a49">prefButtonState</a>,
  147. 00291 <a class="code" href="PVRShell_8h.html#a77a50">prefCaptureFrameStart</a>,
  148. 00292 <a class="code" href="PVRShell_8h.html#a77a51">prefCaptureFrameStop</a>,
  149. 00293 <a class="code" href="PVRShell_8h.html#a77a52">prefPriority</a>,
  150. 00294 <a class="code" href="PVRShell_8h.html#a77a53">prefConfig</a>,
  151. 00295 <a class="code" href="PVRShell_8h.html#a77a54">prefRequestedConfig</a>,
  152. 00296 <a class="code" href="PVRShell_8h.html#a77a55">prefNativeDisplay</a>
  153. 00297 };
  154. 00298
  155. 00299 <span class="comment">/*!***********************************************************************</span>
  156. 00300 <span class="comment"> * @Enum prefNamePtrEnum</span>
  157. 00301 <span class="comment"> * @Brief Pointers/Handlers Shell preferences.</span>
  158. 00302 <span class="comment"> ************************************************************************/</span>
  159. 00303 <span class="keyword">enum</span> <a class="code" href="PVRShell_8h.html#a78">prefNamePtrEnum</a>
  160. 00304 {
  161. 00305 <a class="code" href="PVRShell_8h.html#a78a56">prefD3DDevice</a>,
  162. 00306 <a class="code" href="PVRShell_8h.html#a78a57">prefEGLDisplay</a>,
  163. <a name="l00307"></a><a class="code" href="PVRShell_8h.html#a78">00307</a> <a class="code" href="PVRShell_8h.html#a78a58">prefEGLSurface</a>,
  164. 00308 <a class="code" href="PVRShell_8h.html#a78a59">prefHINSTANCE</a>,
  165. 00309 <a class="code" href="PVRShell_8h.html#a78a60">prefNativeWindowType</a>,
  166. 00310 <a class="code" href="PVRShell_8h.html#a78a61">prefAccelerometer</a>,
  167. 00311 <a class="code" href="PVRShell_8h.html#a78a62">prefPointerLocation</a>,
  168. 00312 <a class="code" href="PVRShell_8h.html#a78a63">prefPVR2DContext</a>
  169. 00313 };
  170. 00314
  171. 00315 <span class="comment">/*!***********************************************************************</span>
  172. 00316 <span class="comment"> * @Enum prefNameConstPtrEnum</span>
  173. 00317 <span class="comment"> * @Brief Constant pointers Shell preferences.</span>
  174. 00318 <span class="comment"> ************************************************************************/</span>
  175. 00319 <span class="keyword">enum</span> <a class="code" href="PVRShell_8h.html#a79">prefNameConstPtrEnum</a>
  176. 00320 {
  177. 00321 <a class="code" href="PVRShell_8h.html#a79a64">prefAppName</a>,
  178. 00322 <a class="code" href="PVRShell_8h.html#a79a65">prefReadPath</a>,
  179. <a name="l00323"></a><a class="code" href="PVRShell_8h.html#a79">00323</a> <a class="code" href="PVRShell_8h.html#a79a66">prefWritePath</a>,
  180. 00324 <a class="code" href="PVRShell_8h.html#a79a67">prefCommandLine</a>,
  181. 00325 <a class="code" href="PVRShell_8h.html#a79a68">prefCommandLineOpts</a>,
  182. 00326 <a class="code" href="PVRShell_8h.html#a79a69">prefExitMessage</a>,
  183. 00327 <a class="code" href="PVRShell_8h.html#a79a70">prefVersion</a>
  184. 00328 };
  185. 00329
  186. 00330 <span class="comment">/****************************************************************************</span>
  187. 00331 <span class="comment"> PVRShell implementation Prototypes and definitions</span>
  188. 00332 <span class="comment">*****************************************************************************/</span>
  189. 00333
  190. 00334 <span class="keyword">struct </span><a class="code" href="structPVRShellData.html">PVRShellData</a>;
  191. 00335
  192. 00336 <span class="comment">/*!***************************************************************************</span>
  193. 00337 <span class="comment"> * @Class PVRShellInit</span>
  194. 00338 <span class="comment"> *****************************************************************************/</span>
  195. 00339 <span class="keyword">class </span><a class="code" href="classPVRShellInit.html">PVRShellInit</a>;
  196. 00340
  197. 00341 <span class="comment">/*!***********************************************************************</span>
  198. 00342 <span class="comment"> * @Struct SCmdLineOpt</span>
  199. 00343 <span class="comment"> * @Brief Stores a variable name/value pair for an individual command-line option.</span>
  200. 00344 <span class="comment"> ************************************************************************/</span>
  201. 00345 <span class="keyword">struct </span><a class="code" href="structSCmdLineOpt.html">SCmdLineOpt</a>
  202. 00346 {
  203. 00347 <span class="keyword">const</span> <span class="keywordtype">char</span> *pArg, *pVal;
  204. 00348 };
  205. <a name="l00349"></a><a class="code" href="structSCmdLineOpt.html">00349</a>
  206. 00350 <span class="comment">/*!***************************************************************************</span>
  207. <a name="l00351"></a><a class="code" href="structSCmdLineOpt.html#o1">00351</a> <span class="comment"> * @Class PVRShell</span>
  208. 00352 <span class="comment"> * @Brief Inherited by the application; responsible for abstracting the OS and API.</span>
  209. 00353 <span class="comment"> * @Description</span>
  210. 00354 <span class="comment"> * PVRShell is the main Shell class that an application uses. An</span>
  211. 00355 <span class="comment"> * application should supply a class which inherits PVRShell and supplies</span>
  212. 00356 <span class="comment"> * implementations of the virtual functions of PVRShell (InitApplication(),</span>
  213. 00357 <span class="comment"> * QuitApplication(), InitView(), ReleaseView(), RenderScene()). Default stub</span>
  214. 00358 <span class="comment"> * functions are supplied; this means that an application is not</span>
  215. 00359 <span class="comment"> * required to supply a particular function if it does not need to do anything</span>
  216. 00360 <span class="comment"> * in it.</span>
  217. 00361 <span class="comment"> * The other, non-virtual, functions of PVRShell are utility functions that the</span>
  218. 00362 <span class="comment"> * application may call.</span>
  219. 00363 <span class="comment"> *****************************************************************************/</span>
  220. 00364 <span class="keyword">class </span><a class="code" href="classPVRShell.html">PVRShell</a>
  221. 00365 {
  222. 00366 <span class="keyword">private</span>:
  223. 00367 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classPVRShellInitOS.html">PVRShellInitOS</a>;
  224. 00368 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classPVRShellInit.html">PVRShellInit</a>;
  225. <a name="l00369"></a><a class="code" href="classPVRShell.html">00369</a>
  226. 00370 <a class="code" href="structPVRShellData.html">PVRShellData</a> *m_pShellData;
  227. 00371 <a class="code" href="classPVRShellInit.html">PVRShellInit</a> *m_pShellInit;
  228. <a name="l00372"></a><a class="code" href="classPVRShell.html#n0">00372</a>
  229. <a name="l00373"></a><a class="code" href="classPVRShell.html#n1">00373</a> <span class="keyword">public</span>:
  230. 00374 <span class="comment">/*!***********************************************************************</span>
  231. 00375 <span class="comment"> @Function PVRShell</span>
  232. 00376 <span class="comment"> @Description Constructor</span>
  233. 00377 <span class="comment"> *************************************************************************/</span>
  234. 00378 <a class="code" href="classPVRShell.html#a0">PVRShell</a>();
  235. 00379
  236. 00380 <span class="comment">/*!***********************************************************************</span>
  237. 00381 <span class="comment"> @Function ~PVRShell</span>
  238. 00382 <span class="comment"> @Description Destructor</span>
  239. 00383 <span class="comment"> *************************************************************************/</span>
  240. 00384 <span class="keyword">virtual</span> <a class="code" href="classPVRShell.html#a1">~PVRShell</a>();
  241. 00385
  242. 00386 <span class="comment">/*</span>
  243. 00387 <span class="comment"> PVRShell functions that the application should implement.</span>
  244. 00388 <span class="comment"> */</span>
  245. 00389
  246. 00390 <span class="comment">/*!***********************************************************************</span>
  247. 00391 <span class="comment"> @Function InitApplication</span>
  248. 00392 <span class="comment"> @Return true for success, false to exit the application</span>
  249. 00393 <span class="comment"> @Description This function can be overloaded by the application. It</span>
  250. 00394 <span class="comment"> will be called by PVRShell once only at the beginning of</span>
  251. 00395 <span class="comment"> the PVRShell WinMain()/main() function. This function</span>
  252. 00396 <span class="comment"> enables the user to perform any initialisation before the</span>
  253. 00397 <span class="comment"> render API is initialised. From this function the user can</span>
  254. 00398 <span class="comment"> call PVRShellSet() to change default values, e.g.</span>
  255. 00399 <span class="comment"> requesting a particular resolution or device setting.</span>
  256. 00400 <span class="comment"> *************************************************************************/</span>
  257. 00401 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a2">InitApplication</a>() { <span class="keywordflow">return</span> <span class="keyword">true</span>; };
  258. 00402
  259. 00403 <span class="comment">/*!***********************************************************************</span>
  260. 00404 <span class="comment"> @Function QuitApplication</span>
  261. 00405 <span class="comment"> @Return true for success, false to exit the application</span>
  262. 00406 <span class="comment"> @Description This function can be overloaded by the application. It</span>
  263. 00407 <span class="comment"> will be called by PVRShell just before finishing the</span>
  264. 00408 <span class="comment"> program. It enables the application to release any</span>
  265. <a name="l00409"></a><a class="code" href="classPVRShell.html#a2">00409</a> <span class="comment"> memory/resources acquired in InitApplication().</span>
  266. 00410 <span class="comment"> *************************************************************************/</span>
  267. 00411 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a3">QuitApplication</a>() { <span class="keywordflow">return</span> <span class="keyword">true</span>; };
  268. 00412
  269. 00413 <span class="comment">/*!***********************************************************************</span>
  270. 00414 <span class="comment"> @Function InitView</span>
  271. 00415 <span class="comment"> @Return true for success, false to exit the application</span>
  272. 00416 <span class="comment"> @Description This function can be overloaded by the application. It</span>
  273. 00417 <span class="comment"> will be called by PVRShell after the OS and rendering API</span>
  274. 00418 <span class="comment"> are initialised, before entering the RenderScene() loop.</span>
  275. 00419 <span class="comment"> It is called any time the rendering API is initialised,</span>
  276. <a name="l00420"></a><a class="code" href="classPVRShell.html#a3">00420</a> <span class="comment"> i.e. once at the beginning, and possibly again if the</span>
  277. 00421 <span class="comment"> resolution changes, or a power management even occurs, or</span>
  278. 00422 <span class="comment"> if the app requests a reinialisation.</span>
  279. 00423 <span class="comment"> The application should check here the configuration of</span>
  280. 00424 <span class="comment"> the rendering API; it is possible that requests made in</span>
  281. 00425 <span class="comment"> InitApplication() were not successful.</span>
  282. 00426 <span class="comment"> Since everything is initialised when this function is</span>
  283. 00427 <span class="comment"> called, you can load textures and perform rendering API</span>
  284. 00428 <span class="comment"> functions.</span>
  285. 00429 <span class="comment"> *************************************************************************/</span>
  286. 00430 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a4">InitView</a>() { <span class="keywordflow">return</span> <span class="keyword">true</span>; };
  287. 00431
  288. 00432 <span class="comment">/*!***********************************************************************</span>
  289. 00433 <span class="comment"> @Function ReleaseView</span>
  290. 00434 <span class="comment"> @Return true for success, false to exit the application</span>
  291. 00435 <span class="comment"> @Description This function can be overloaded by the application. It</span>
  292. 00436 <span class="comment"> will be called after the RenderScene() loop, before</span>
  293. 00437 <span class="comment"> shutting down the render API. It enables the application</span>
  294. 00438 <span class="comment"> to release any memory/resources acquired in InitView().</span>
  295. 00439 <span class="comment"> *************************************************************************/</span>
  296. <a name="l00440"></a><a class="code" href="classPVRShell.html#a4">00440</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a5">ReleaseView</a>() { <span class="keywordflow">return</span> <span class="keyword">true</span>; };
  297. 00441
  298. 00442 <span class="comment">/*!***********************************************************************</span>
  299. 00443 <span class="comment"> @Function RenderScene</span>
  300. 00444 <span class="comment"> @Return true for success, false to exit the application</span>
  301. 00445 <span class="comment"> @Description This function can be overloaded by the application.</span>
  302. 00446 <span class="comment"> It is main application function in which you have to do your own rendering. Will be</span>
  303. 00447 <span class="comment"> called repeatedly until the application exits.</span>
  304. 00448 <span class="comment"> *************************************************************************/</span>
  305. 00449 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a6">RenderScene</a>() { <span class="keywordflow">return</span> <span class="keyword">true</span>; };
  306. 00450
  307. <a name="l00451"></a><a class="code" href="classPVRShell.html#a5">00451</a> <span class="comment">/*</span>
  308. 00452 <span class="comment"> PVRShell functions available for the application to use.</span>
  309. 00453 <span class="comment"> */</span>
  310. 00454
  311. 00455 <span class="comment">/*!***********************************************************************</span>
  312. 00456 <span class="comment"> @Function PVRShellSet</span>
  313. 00457 <span class="comment"> @Input prefName Name of preference to set to value</span>
  314. 00458 <span class="comment"> @Input value Value</span>
  315. 00459 <span class="comment"> @Return true for success</span>
  316. 00460 <span class="comment"> @Description This function is used to pass preferences to the PVRShell.</span>
  317. <a name="l00461"></a><a class="code" href="classPVRShell.html#a6">00461</a> <span class="comment"> If used, it must be called from InitApplication().</span>
  318. 00462 <span class="comment"> *************************************************************************/</span>
  319. 00463 <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a7">PVRShellSet</a>(<span class="keyword">const</span> prefNameBoolEnum prefName, <span class="keyword">const</span> <span class="keywordtype">bool</span> value);
  320. 00464
  321. 00465 <span class="comment">/*!***********************************************************************</span>
  322. 00466 <span class="comment"> @Function PVRShellSet</span>
  323. 00467 <span class="comment"> @Input prefName Name of preference to set to value</span>
  324. 00468 <span class="comment"> @Input value Value</span>
  325. 00469 <span class="comment"> @Return true for success</span>
  326. 00470 <span class="comment"> @Description This function is used to pass preferences to the PVRShell.</span>
  327. 00471 <span class="comment"> If used, it must be called from InitApplication().</span>
  328. 00472 <span class="comment"> *************************************************************************/</span>
  329. 00473 <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a7">PVRShellSet</a>(<span class="keyword">const</span> prefNameFloatEnum prefName, <span class="keyword">const</span> <span class="keywordtype">float</span> value);
  330. 00474
  331. 00475 <span class="comment">/*!***********************************************************************</span>
  332. 00476 <span class="comment"> @Function PVRShellSet</span>
  333. 00477 <span class="comment"> @Input prefName Name of preference to set to value</span>
  334. 00478 <span class="comment"> @Input value Value</span>
  335. 00479 <span class="comment"> @Return true for success</span>
  336. 00480 <span class="comment"> @Description This function is used to pass preferences to the PVRShell.</span>
  337. 00481 <span class="comment"> If used, it must be called from InitApplication().</span>
  338. 00482 <span class="comment"> *************************************************************************/</span>
  339. 00483 <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a7">PVRShellSet</a>(<span class="keyword">const</span> prefNameIntEnum prefName, <span class="keyword">const</span> <span class="keywordtype">int</span> value);
  340. 00484
  341. 00485 <span class="comment">/*!***********************************************************************</span>
  342. 00486 <span class="comment"> @Function PVRShellSet</span>
  343. 00487 <span class="comment"> @Input prefName Name of preference to set to value</span>
  344. 00488 <span class="comment"> @Input ptrValue Value</span>
  345. 00489 <span class="comment"> @Return true for success</span>
  346. 00490 <span class="comment"> @Description This function is used to pass preferences to the PVRShell.</span>
  347. 00491 <span class="comment"> If used, it must be called from InitApplication().</span>
  348. 00492 <span class="comment"> *************************************************************************/</span>
  349. 00493 <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a7">PVRShellSet</a>(<span class="keyword">const</span> prefNamePtrEnum prefName, <span class="keyword">const</span> <span class="keywordtype">void</span> * <span class="keyword">const</span> ptrValue);
  350. 00494
  351. 00495 <span class="comment">/*!***********************************************************************</span>
  352. 00496 <span class="comment"> @Function PVRShellSet</span>
  353. 00497 <span class="comment"> @Input prefName Name of preference to set to value</span>
  354. 00498 <span class="comment"> @Input ptrValue Value</span>
  355. 00499 <span class="comment"> @Return true for success</span>
  356. 00500 <span class="comment"> @Description This function is used to pass preferences to the PVRShell.</span>
  357. 00501 <span class="comment"> If used, it must be called from InitApplication().</span>
  358. 00502 <span class="comment"> *************************************************************************/</span>
  359. 00503 <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a7">PVRShellSet</a>(<span class="keyword">const</span> prefNameConstPtrEnum prefName, <span class="keyword">const</span> <span class="keywordtype">void</span> * <span class="keyword">const</span> ptrValue);
  360. 00504
  361. 00505 <span class="comment">/*!***********************************************************************</span>
  362. 00506 <span class="comment"> @Function PVRShellGet</span>
  363. 00507 <span class="comment"> @Input prefName Name of preference to set to value</span>
  364. 00508 <span class="comment"> @Return Value asked for.</span>
  365. 00509 <span class="comment"> @Description This function is used to get parameters from the PVRShell</span>
  366. 00510 <span class="comment"> It can be called from any where in the program.</span>
  367. 00511 <span class="comment"> *************************************************************************/</span>
  368. 00512 <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a12">PVRShellGet</a>(<span class="keyword">const</span> prefNameBoolEnum prefName) <span class="keyword">const</span>;
  369. 00513
  370. 00514 <span class="comment">/*!***********************************************************************</span>
  371. 00515 <span class="comment"> @Function PVRShellGet</span>
  372. 00516 <span class="comment"> @Input prefName Name of preference to set to value</span>
  373. 00517 <span class="comment"> @Return Value asked for.</span>
  374. 00518 <span class="comment"> @Description This function is used to get parameters from the PVRShell</span>
  375. 00519 <span class="comment"> It can be called from any where in the program.</span>
  376. 00520 <span class="comment"> *************************************************************************/</span>
  377. 00521 <span class="keywordtype">float</span> <a class="code" href="classPVRShell.html#a12">PVRShellGet</a>(<span class="keyword">const</span> prefNameFloatEnum prefName) <span class="keyword">const</span>;
  378. 00522
  379. 00523 <span class="comment">/*!***********************************************************************</span>
  380. 00524 <span class="comment"> @Function PVRShellGet</span>
  381. 00525 <span class="comment"> @Input prefName Name of preference to set to value</span>
  382. 00526 <span class="comment"> @Return Value asked for.</span>
  383. 00527 <span class="comment"> @Description This function is used to get parameters from the PVRShell</span>
  384. 00528 <span class="comment"> It can be called from any where in the program.</span>
  385. 00529 <span class="comment"> *************************************************************************/</span>
  386. 00530 <span class="keywordtype">int</span> <a class="code" href="classPVRShell.html#a12">PVRShellGet</a>(<span class="keyword">const</span> prefNameIntEnum prefName) <span class="keyword">const</span>;
  387. 00531
  388. 00532 <span class="comment">/*!***********************************************************************</span>
  389. 00533 <span class="comment"> @Function PVRShellGet</span>
  390. 00534 <span class="comment"> @Input prefName Name of preference to set to value</span>
  391. 00535 <span class="comment"> @Return Value asked for.</span>
  392. 00536 <span class="comment"> @Description This function is used to get parameters from the PVRShell</span>
  393. 00537 <span class="comment"> It can be called from any where in the program.</span>
  394. 00538 <span class="comment"> *************************************************************************/</span>
  395. 00539 <span class="keywordtype">void</span> *<a class="code" href="classPVRShell.html#a12">PVRShellGet</a>(<span class="keyword">const</span> prefNamePtrEnum prefName) <span class="keyword">const</span>;
  396. 00540
  397. 00541 <span class="comment">/*!***********************************************************************</span>
  398. 00542 <span class="comment"> @Function PVRShellGet</span>
  399. 00543 <span class="comment"> @Input prefName Name of preference to set to value</span>
  400. 00544 <span class="comment"> @Return Value asked for.</span>
  401. 00545 <span class="comment"> @Description This function is used to get parameters from the PVRShell</span>
  402. 00546 <span class="comment"> It can be called from any where in the program.</span>
  403. 00547 <span class="comment"> *************************************************************************/</span>
  404. 00548 <span class="keyword">const</span> <span class="keywordtype">void</span> *<a class="code" href="classPVRShell.html#a12">PVRShellGet</a>(<span class="keyword">const</span> prefNameConstPtrEnum prefName) <span class="keyword">const</span>;
  405. 00549
  406. 00550 <span class="comment">/*!***********************************************************************</span>
  407. 00551 <span class="comment"> @Function PVRShellScreenCaptureBuffer</span>
  408. 00552 <span class="comment"> @Input Width size of image to capture (relative to 0,0)</span>
  409. 00553 <span class="comment"> @Input Height size of image to capture (relative to 0,0)</span>
  410. 00554 <span class="comment"> @Modified pLines receives a pointer to an area of memory containing the screen buffer.</span>
  411. 00555 <span class="comment"> @Return true for success</span>
  412. 00556 <span class="comment"> @Description It will be stored as 24-bit per pixel, 8-bit per chanel RGB. The</span>
  413. 00557 <span class="comment"> memory should be freed with free() when no longer needed.</span>
  414. 00558 <span class="comment"> *************************************************************************/</span>
  415. 00559 <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a17">PVRShellScreenCaptureBuffer</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> Width, <span class="keyword">const</span> <span class="keywordtype">int</span> Height, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> **pLines);
  416. 00560
  417. 00561 <span class="comment">/*!***********************************************************************</span>
  418. 00562 <span class="comment"> @Function PVRShellScreenSave</span>
  419. 00563 <span class="comment"> @Input fname base of file to save screen to</span>
  420. 00564 <span class="comment"> @Modified pLines image data to write out (24bpp, 8-bit per channel RGB)</span>
  421. 00565 <span class="comment"> @Output ofname If non-NULL, receives the filename actually used</span>
  422. 00566 <span class="comment"> @Return true for success</span>
  423. 00567 <span class="comment"> @Description Writes out the image data to a BMP file with basename</span>
  424. 00568 <span class="comment"> fname. The file written will be fname suffixed with a</span>
  425. 00569 <span class="comment"> number to make the file unique.</span>
  426. 00570 <span class="comment"> For example, if fname is "abc", this function will attempt</span>
  427. 00571 <span class="comment"> to save to "abc0000.bmp"; if that file already exists, it</span>
  428. 00572 <span class="comment"> will try "abc0001.bmp", repeating until a new filename is</span>
  429. 00573 <span class="comment"> found. The final filename used is returned in ofname.</span>
  430. 00574 <span class="comment"> *************************************************************************/</span>
  431. 00575 <span class="keywordtype">int</span> <a class="code" href="classPVRShell.html#a18">PVRShellScreenSave</a>(
  432. 00576 <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> fname,
  433. 00577 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pLines,
  434. 00578 <span class="keywordtype">char</span> * <span class="keyword">const</span> ofname = NULL);
  435. 00579
  436. 00580 <span class="comment">/*!***********************************************************************</span>
  437. 00581 <span class="comment"> @Function PVRShellWriteBMPFile</span>
  438. 00582 <span class="comment"> @Input pszFilename file to save screen to</span>
  439. 00583 <span class="comment"> @Input uWidth the width of the data</span>
  440. 00584 <span class="comment"> @Input uHeight the height of the data</span>
  441. 00585 <span class="comment"> @Input pImageData image data to write out (24bpp, 8-bit per channel RGB)</span>
  442. 00586 <span class="comment"> @Return 0 on success</span>
  443. 00587 <span class="comment"> @Description Writes out the image data to a BMP file with name fname.</span>
  444. 00588 <span class="comment"> *************************************************************************/</span>
  445. 00589 <span class="keywordtype">int</span> <a class="code" href="classPVRShell.html#a19">PVRShellWriteBMPFile</a>(
  446. 00590 <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pszFilename,
  447. 00591 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> uWidth,
  448. 00592 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> uHeight,
  449. 00593 <span class="keyword">const</span> <span class="keywordtype">void</span> * <span class="keyword">const</span> pImageData);
  450. 00594
  451. 00595 <span class="comment">/*!***********************************************************************</span>
  452. 00596 <span class="comment"> @Function PVRShellOutputDebug</span>
  453. 00597 <span class="comment"> @Input format printf style format followed by arguments it requires</span>
  454. 00598 <span class="comment"> @Description Writes the resultant string to the debug output (e.g. using</span>
  455. 00599 <span class="comment"> printf(), OutputDebugString(), ...). Check the SDK release notes for</span>
  456. 00600 <span class="comment"> details on how the string is output.</span>
  457. 00601 <span class="comment"> *************************************************************************/</span>
  458. 00602 <span class="keywordtype">void</span> <a class="code" href="classPVRShell.html#a20">PVRShellOutputDebug</a>(<span class="keywordtype">char</span> <span class="keyword">const</span> * <span class="keyword">const</span> format, ...) <span class="keyword">const</span>;
  459. 00603
  460. 00604 <span class="comment">/*!***********************************************************************</span>
  461. 00605 <span class="comment"> @Function PVRShellGetTime</span>
  462. 00606 <span class="comment"> @Returns A value which increments once per millisecond.</span>
  463. 00607 <span class="comment"> @Description The number itself should be considered meaningless; an</span>
  464. 00608 <span class="comment"> application should use this function to determine how much</span>
  465. 00609 <span class="comment"> time has passed between two points (e.g. between each</span>
  466. 00610 <span class="comment"> frame).</span>
  467. 00611 <span class="comment"> *************************************************************************/</span>
  468. 00612 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classPVRShell.html#a21">PVRShellGetTime</a>();
  469. 00613
  470. 00614 <span class="comment">/*!***********************************************************************</span>
  471. 00615 <span class="comment"> @Function PVRShellIsKeyPressed</span>
  472. 00616 <span class="comment"> @Input key Code of the key to test</span>
  473. 00617 <span class="comment"> @Return true if key was pressed</span>
  474. 00618 <span class="comment"> @Description Check if a key was pressed. The keys on various devices</span>
  475. 00619 <span class="comment"> are mapped to the PVRShell-supported keys (listed in @a PVRShellKeyName) in</span>
  476. 00620 <span class="comment"> a platform-dependent manner, since most platforms have different input</span>
  477. 00621 <span class="comment"> devices. Check the SDK release notes for details on how the enum values</span>
  478. 00622 <span class="comment"> map to your device's input device.</span>
  479. 00623 <span class="comment"> *************************************************************************/</span>
  480. 00624 <span class="keywordtype">bool</span> <a class="code" href="classPVRShell.html#a22">PVRShellIsKeyPressed</a>(<span class="keyword">const</span> PVRShellKeyName key);
  481. 00625 };
  482. 00626
  483. 00627 <span class="comment">/****************************************************************************</span>
  484. 00628 <span class="comment">** Declarations for functions that the scene file must supply</span>
  485. 00629 <span class="comment">****************************************************************************/</span>
  486. 00630
  487. 00631 <span class="comment">/*!***************************************************************************</span>
  488. 00632 <span class="comment"> @Function NewDemo</span>
  489. 00633 <span class="comment"> @Return The demo supplied by the user</span>
  490. 00634 <span class="comment"> @Description This function must be implemented by the user of the shell.</span>
  491. 00635 <span class="comment"> The user should return its PVRShell object defining the</span>
  492. 00636 <span class="comment"> behaviour of the application</span>
  493. 00637 <span class="comment">*****************************************************************************/</span>
  494. 00638 <a class="code" href="classPVRShell.html">PVRShell</a>* <a class="code" href="PVRShell_8h.html#a71">NewDemo</a>();
  495. 00639
  496. 00640 <span class="preprocessor">#endif </span><span class="comment">/* __PVRSHELL_H_ */</span>
  497. 00641
  498. 00642 <span class="comment">/*****************************************************************************</span>
  499. 00643 <span class="comment"> End of file (PVRShell.h)</span>
  500. 00644 <span class="comment">*****************************************************************************/</span>
  501. 00645
  502. 00646
  503. </pre></div><br>
  504. <br>
  505. <P align=left><FONT size=2><STRONG><A
  506. href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> ©
  507. 1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
  508. <hr>
  509. <address style="align: left;"><small><FONT color=f0f>
  510. Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
  511. </body>
  512. </html>