PVRTPFXParserAPI_8h-source.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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>PVRTPFXParserAPI.h</h1><a href="PVRTPFXParserAPI_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 PVRTPFXParserAPI.h</span>
  26. 00004 <span class="comment"></span>
  27. 00005 <span class="comment"> @Title OGLES2/PVRTPFXParserAPI.h</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 Windows + Linux</span>
  34. 00012 <span class="comment"></span>
  35. 00013 <span class="comment"> @Description Declaration of PFX file parser</span>
  36. 00014 <span class="comment"></span>
  37. 00015 <span class="comment">******************************************************************************/</span>
  38. 00016
  39. 00017 <span class="preprocessor">#ifndef _PVRTPFXPARSERAPI_H_</span>
  40. 00018 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTPFXPARSERAPI_H_</span>
  41. 00019 <span class="preprocessor"></span>
  42. 00020 <span class="preprocessor">#include "../PVRTError.h"</span>
  43. 00021
  44. 00022 <span class="comment">/****************************************************************************</span>
  45. 00023 <span class="comment">** Structures</span>
  46. 00024 <span class="comment">****************************************************************************/</span>
  47. 00025
  48. <a name="l00027"></a><a class="code" href="structSPVRTPFXUniformSemantic.html">00027</a> <span class="keyword">struct </span><a class="code" href="structSPVRTPFXUniformSemantic.html">SPVRTPFXUniformSemantic</a>
  49. 00028 {
  50. <a name="l00029"></a><a class="code" href="structSPVRTPFXUniformSemantic.html#o0">00029</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structSPVRTPFXUniformSemantic.html#o0">p</a>; <span class="comment">// String containing semantic</span>
  51. <a name="l00030"></a><a class="code" href="structSPVRTPFXUniformSemantic.html#o1">00030</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structSPVRTPFXUniformSemantic.html#o1">n</a>; <span class="comment">// Application-defined semantic value</span>
  52. 00031 };
  53. 00032
  54. <a name="l00034"></a><a class="code" href="structSPVRTPFXUniform.html">00034</a> <span class="keyword">struct </span><a class="code" href="structSPVRTPFXUniform.html">SPVRTPFXUniform</a>
  55. 00035 {
  56. <a name="l00036"></a><a class="code" href="structSPVRTPFXUniform.html#o0">00036</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structSPVRTPFXUniform.html#o0">nLocation</a>; <span class="comment">// GL location of the Uniform</span>
  57. <a name="l00037"></a><a class="code" href="structSPVRTPFXUniform.html#o1">00037</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structSPVRTPFXUniform.html#o1">nSemantic</a>; <span class="comment">// Application-defined semantic value</span>
  58. <a name="l00038"></a><a class="code" href="structSPVRTPFXUniform.html#o2">00038</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structSPVRTPFXUniform.html#o2">nIdx</a>; <span class="comment">// Index; for example two semantics might be LIGHTPOSITION0 and LIGHTPOSITION1</span>
  59. 00039 };
  60. 00040
  61. <a name="l00042"></a><a class="code" href="structSPVRTPFXTexture.html">00042</a> <span class="keyword">struct </span><a class="code" href="structSPVRTPFXTexture.html">SPVRTPFXTexture</a>
  62. 00043 {
  63. <a name="l00044"></a><a class="code" href="structSPVRTPFXTexture.html#o0">00044</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *p; <span class="comment">// texture FileName</span>
  64. <a name="l00045"></a><a class="code" href="structSPVRTPFXTexture.html#o1">00045</a> GLuint <a class="code" href="structSPVRTPFXTexture.html#o1">ui</a>; <span class="comment">// Loaded texture handle</span>
  65. 00046 };
  66. 00047
  67. 00048 <span class="comment">/*!**************************************************************************</span>
  68. 00049 <span class="comment">@Class CPVRTPFXEffect</span>
  69. 00050 <span class="comment">@Brief PFX effect</span>
  70. 00051 <span class="comment">****************************************************************************/</span>
  71. <a name="l00052"></a><a class="code" href="classCPVRTPFXEffect.html">00052</a> <span class="keyword">class </span><a class="code" href="classCPVRTPFXEffect.html">CPVRTPFXEffect</a>
  72. 00053 {
  73. 00054 <span class="keyword">public</span>:
  74. <a name="l00055"></a><a class="code" href="classCPVRTPFXEffect.html#o0">00055</a> <a class="code" href="structSPVRTContext.html">SPVRTContext</a> *<a class="code" href="classCPVRTPFXEffect.html#o0">m_psContext</a>;
  75. <a name="l00056"></a><a class="code" href="classCPVRTPFXEffect.html#o1">00056</a> <a class="code" href="classCPVRTPFXParser.html">CPVRTPFXParser</a> *<a class="code" href="classCPVRTPFXEffect.html#o1">m_pParser</a>;
  76. <a name="l00057"></a><a class="code" href="classCPVRTPFXEffect.html#o2">00057</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCPVRTPFXEffect.html#o2">m_nEffect</a>;
  77. 00058
  78. <a name="l00059"></a><a class="code" href="classCPVRTPFXEffect.html#o3">00059</a> GLuint <a class="code" href="classCPVRTPFXEffect.html#o3">m_uiProgram</a>; <span class="comment">// Loaded program</span>
  79. <a name="l00060"></a><a class="code" href="classCPVRTPFXEffect.html#o4">00060</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *<a class="code" href="classCPVRTPFXEffect.html#o4">m_pnTextureIdx</a>; <span class="comment">// Array of indices into the texture array</span>
  80. 00061
  81. <a name="l00062"></a><a class="code" href="classCPVRTPFXEffect.html#o5">00062</a> <a class="code" href="structSPVRTPFXTexture.html">SPVRTPFXTexture</a> *<a class="code" href="classCPVRTPFXEffect.html#o5">m_psTextures</a>; <span class="comment">// Array of loaded textures</span>
  82. 00063
  83. 00064 <span class="keyword">public</span>:
  84. 00065 <span class="comment">/*!***************************************************************************</span>
  85. 00066 <span class="comment"> @Function CPVRTPFXEffect Blank Constructor</span>
  86. 00067 <span class="comment"> @Description Sets the context and initialises the member variables to zero.</span>
  87. 00068 <span class="comment"> *****************************************************************************/</span>
  88. 00069 <a class="code" href="classCPVRTPFXEffect.html#a0">CPVRTPFXEffect</a>();
  89. 00070
  90. 00071 <span class="comment">/*!***************************************************************************</span>
  91. 00072 <span class="comment"> @Function CPVRTPFXEffect Constructor</span>
  92. 00073 <span class="comment"> @Description Sets the context and initialises the member variables to zero.</span>
  93. 00074 <span class="comment"> *****************************************************************************/</span>
  94. 00075 <a class="code" href="classCPVRTPFXEffect.html#a0">CPVRTPFXEffect</a>(<a class="code" href="structSPVRTContext.html">SPVRTContext</a> &amp;sContext);
  95. 00076
  96. 00077 <span class="comment">/*!***************************************************************************</span>
  97. 00078 <span class="comment"> @Function CPVRTPFXEffect Destructor</span>
  98. 00079 <span class="comment"> @Description Calls Destroy().</span>
  99. 00080 <span class="comment"> *****************************************************************************/</span>
  100. 00081 <a class="code" href="classCPVRTPFXEffect.html#a2">~CPVRTPFXEffect</a>();
  101. 00082
  102. 00083 <span class="comment">/*!***************************************************************************</span>
  103. 00084 <span class="comment"> @Function Load</span>
  104. 00085 <span class="comment"> @Input src PFX Parser Object</span>
  105. 00086 <span class="comment"> @Input pszEffect Effect name</span>
  106. 00087 <span class="comment"> @Input pszFileName Effect file name</span>
  107. 00088 <span class="comment"> @Output pReturnError Error string</span>
  108. 00089 <span class="comment"> @Returns EPVRTError PVR_SUCCESS if load succeeded</span>
  109. 00090 <span class="comment"> @Description Loads the specified effect from the CPVRTPFXParser object.</span>
  110. 00091 <span class="comment"> Compiles and links the shaders. Initialises texture data.</span>
  111. 00092 <span class="comment"> *****************************************************************************/</span>
  112. 00093 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPFXEffect.html#a3">Load</a>(<a class="code" href="classCPVRTPFXParser.html">CPVRTPFXParser</a> &amp;src, <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pszEffect, <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pszFileName, <a class="code" href="classCPVRTString.html">CPVRTString</a> *pReturnError);
  113. 00094
  114. 00095 <span class="comment">/*!***************************************************************************</span>
  115. 00096 <span class="comment"> @Function Destroy</span>
  116. 00097 <span class="comment"> @Description Deletes the gl program object and texture data.</span>
  117. 00098 <span class="comment"> *****************************************************************************/</span>
  118. 00099 <span class="keywordtype">void</span> <a class="code" href="classCPVRTPFXEffect.html#a4">Destroy</a>();
  119. 00100
  120. 00101 <span class="comment">/*!***************************************************************************</span>
  121. 00102 <span class="comment"> @Function Activate</span>
  122. 00103 <span class="comment"> @Returns PVR_SUCCESS if activate succeeded</span>
  123. 00104 <span class="comment"> @Description Selects the gl program object and binds the textures.</span>
  124. 00105 <span class="comment"> *****************************************************************************/</span>
  125. 00106 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPFXEffect.html#a5">Activate</a>();
  126. 00107
  127. 00108 <span class="comment">/*!***************************************************************************</span>
  128. 00109 <span class="comment"> @Function BuildUniformTable</span>
  129. 00110 <span class="comment"> @Output ppsUniforms pointer to uniform data array</span>
  130. 00111 <span class="comment"> @Output pnUniformCount pointer to number of uniforms</span>
  131. 00112 <span class="comment"> @Output pnUnknownUniformCount pointer to number of unknown uniforms</span>
  132. 00113 <span class="comment"> @Input psUniformSemantics pointer to uniform semantic data array</span>
  133. 00114 <span class="comment"> @Input nSemantics number of uniform semantics</span>
  134. 00115 <span class="comment"> @Output pReturnError error string</span>
  135. 00116 <span class="comment"> @Returns EPVRTError PVR_SUCCESS if succeeded</span>
  136. 00117 <span class="comment"> @Description Builds the uniform table from the semantics.</span>
  137. 00118 <span class="comment"> *****************************************************************************/</span>
  138. 00119 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPFXEffect.html#a6">BuildUniformTable</a>(
  139. 00120 <a class="code" href="structSPVRTPFXUniform.html">SPVRTPFXUniform</a> ** <span class="keyword">const</span> ppsUniforms,
  140. 00121 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> * <span class="keyword">const</span> pnUniformCount,
  141. 00122 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> * <span class="keyword">const</span> pnUnknownUniformCount,
  142. 00123 <span class="keyword">const</span> <a class="code" href="structSPVRTPFXUniformSemantic.html">SPVRTPFXUniformSemantic</a> * <span class="keyword">const</span> psUniformSemantics,
  143. 00124 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nSemantics,
  144. 00125 <a class="code" href="classCPVRTString.html">CPVRTString</a> *pReturnError);
  145. 00126
  146. 00127 <span class="comment">/*!***************************************************************************</span>
  147. 00128 <span class="comment"> @Function GetTextureArray</span>
  148. 00129 <span class="comment"> @Output nCount number of textures</span>
  149. 00130 <span class="comment"> @Returns SPVRTPFXTexture* pointer to the texture data array</span>
  150. 00131 <span class="comment"> @Description Gets the texture data array.</span>
  151. 00132 <span class="comment"> *****************************************************************************/</span>
  152. 00133 <span class="keyword">const</span> <a class="code" href="structSPVRTPFXTexture.html">SPVRTPFXTexture</a> *<a class="code" href="classCPVRTPFXEffect.html#a7">GetTextureArray</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> &amp;nCount) <span class="keyword">const</span>;
  153. 00134
  154. 00135 <span class="comment">/*!***************************************************************************</span>
  155. 00136 <span class="comment"> @Function SetTexture</span>
  156. 00137 <span class="comment"> @Input nIdx texture number</span>
  157. 00138 <span class="comment"> @Input ui opengl texture handle</span>
  158. 00139 <span class="comment"> @Input u32flags texture flags</span>
  159. 00140 <span class="comment"> @Description Sets the textrue and applys the filtering.</span>
  160. 00141 <span class="comment"> *****************************************************************************/</span>
  161. 00142 <span class="keywordtype">void</span> <a class="code" href="classCPVRTPFXEffect.html#a8">SetTexture</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nIdx, <span class="keyword">const</span> GLuint ui, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> u32flags=0);
  162. 00143
  163. 00144 <span class="comment">/*!***************************************************************************</span>
  164. 00145 <span class="comment"> @Function SetDefaultSemanticValue</span>
  165. 00146 <span class="comment"> @Input pszName name of uniform</span>
  166. 00147 <span class="comment"> @Input psDefaultValue pointer to default value</span>
  167. 00148 <span class="comment"> @Description Sets the dafault value for the uniform semantic.</span>
  168. 00149 <span class="comment"> *****************************************************************************/</span>
  169. 00150 <span class="keywordtype">void</span> <a class="code" href="classCPVRTPFXEffect.html#a9">SetDefaultUniformValue</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keyword">const</span> pszName, <span class="keyword">const</span> <a class="code" href="structSPVRTSemanticDefaultData.html">SPVRTSemanticDefaultData</a> *psDefaultValue);
  170. 00151
  171. 00152 };
  172. 00153
  173. 00154 <span class="preprocessor">#endif </span><span class="comment">/* _PVRTPFXPARSERAPI_H_ */</span>
  174. 00155
  175. 00156 <span class="comment">/*****************************************************************************</span>
  176. 00157 <span class="comment"> End of file (PVRTPFXParserAPI.h)</span>
  177. 00158 <span class="comment">*****************************************************************************/</span>
  178. 00159
  179. </pre></div><br>
  180. <br>
  181. <P align=left><FONT size=2><STRONG><A
  182. href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> ©
  183. 1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
  184. <hr>
  185. <address style="align: left;"><small><FONT color=f0f>
  186. Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
  187. </body>
  188. </html>