123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
- <title>PowerVR SDK</title>
- <link href="doxygen.css" rel="stylesheet" type="text/css">
- <link href="tabs.css" rel="stylesheet" type="text/css">
- <table width="100%">
- <tr>
- <td width="33%">
- <p align="left"> <a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
- </td>
- <td width="33%">
- <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
- </td>
- <td width="34%">
- <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
- </td>
- </tr>
- </table>
- <hr>
- </head><body>
- <!-- Generated by Doxygen 1.3.6 -->
- <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
- <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>
- 00002 <span class="comment"></span>
- 00003 <span class="comment"> @File PVRTPFXParserAPI.h</span>
- 00004 <span class="comment"></span>
- 00005 <span class="comment"> @Title OGLES2/PVRTPFXParserAPI.h</span>
- 00006 <span class="comment"></span>
- 00007 <span class="comment"> @Version </span>
- 00008 <span class="comment"></span>
- 00009 <span class="comment"> @Copyright Copyright (C) Imagination Technologies Limited.</span>
- 00010 <span class="comment"></span>
- 00011 <span class="comment"> @Platform Windows + Linux</span>
- 00012 <span class="comment"></span>
- 00013 <span class="comment"> @Description Declaration of PFX file parser</span>
- 00014 <span class="comment"></span>
- 00015 <span class="comment">******************************************************************************/</span>
- 00016
- 00017 <span class="preprocessor">#ifndef _PVRTPFXPARSERAPI_H_</span>
- 00018 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTPFXPARSERAPI_H_</span>
- 00019 <span class="preprocessor"></span>
- 00020 <span class="preprocessor">#include "../PVRTError.h"</span>
- 00021
- 00022 <span class="comment">/****************************************************************************</span>
- 00023 <span class="comment">** Structures</span>
- 00024 <span class="comment">****************************************************************************/</span>
- 00025
- <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>
- 00028 {
- <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>
- <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>
- 00031 };
- 00032
- <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>
- 00035 {
- <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>
- <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>
- <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>
- 00039 };
- 00040
- <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>
- 00043 {
- <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>
- <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>
- 00046 };
- 00047
- 00048 <span class="comment">/*!**************************************************************************</span>
- 00049 <span class="comment">@Class CPVRTPFXEffect</span>
- 00050 <span class="comment">@Brief PFX effect</span>
- 00051 <span class="comment">****************************************************************************/</span>
- <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>
- 00053 {
- 00054 <span class="keyword">public</span>:
- <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>;
- <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>;
- <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>;
- 00058
- <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>
- <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>
- 00061
- <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>
- 00063
- 00064 <span class="keyword">public</span>:
- 00065 <span class="comment">/*!***************************************************************************</span>
- 00066 <span class="comment"> @Function CPVRTPFXEffect Blank Constructor</span>
- 00067 <span class="comment"> @Description Sets the context and initialises the member variables to zero.</span>
- 00068 <span class="comment"> *****************************************************************************/</span>
- 00069 <a class="code" href="classCPVRTPFXEffect.html#a0">CPVRTPFXEffect</a>();
- 00070
- 00071 <span class="comment">/*!***************************************************************************</span>
- 00072 <span class="comment"> @Function CPVRTPFXEffect Constructor</span>
- 00073 <span class="comment"> @Description Sets the context and initialises the member variables to zero.</span>
- 00074 <span class="comment"> *****************************************************************************/</span>
- 00075 <a class="code" href="classCPVRTPFXEffect.html#a0">CPVRTPFXEffect</a>(<a class="code" href="structSPVRTContext.html">SPVRTContext</a> &sContext);
- 00076
- 00077 <span class="comment">/*!***************************************************************************</span>
- 00078 <span class="comment"> @Function CPVRTPFXEffect Destructor</span>
- 00079 <span class="comment"> @Description Calls Destroy().</span>
- 00080 <span class="comment"> *****************************************************************************/</span>
- 00081 <a class="code" href="classCPVRTPFXEffect.html#a2">~CPVRTPFXEffect</a>();
- 00082
- 00083 <span class="comment">/*!***************************************************************************</span>
- 00084 <span class="comment"> @Function Load</span>
- 00085 <span class="comment"> @Input src PFX Parser Object</span>
- 00086 <span class="comment"> @Input pszEffect Effect name</span>
- 00087 <span class="comment"> @Input pszFileName Effect file name</span>
- 00088 <span class="comment"> @Output pReturnError Error string</span>
- 00089 <span class="comment"> @Returns EPVRTError PVR_SUCCESS if load succeeded</span>
- 00090 <span class="comment"> @Description Loads the specified effect from the CPVRTPFXParser object.</span>
- 00091 <span class="comment"> Compiles and links the shaders. Initialises texture data.</span>
- 00092 <span class="comment"> *****************************************************************************/</span>
- 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> &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);
- 00094
- 00095 <span class="comment">/*!***************************************************************************</span>
- 00096 <span class="comment"> @Function Destroy</span>
- 00097 <span class="comment"> @Description Deletes the gl program object and texture data.</span>
- 00098 <span class="comment"> *****************************************************************************/</span>
- 00099 <span class="keywordtype">void</span> <a class="code" href="classCPVRTPFXEffect.html#a4">Destroy</a>();
- 00100
- 00101 <span class="comment">/*!***************************************************************************</span>
- 00102 <span class="comment"> @Function Activate</span>
- 00103 <span class="comment"> @Returns PVR_SUCCESS if activate succeeded</span>
- 00104 <span class="comment"> @Description Selects the gl program object and binds the textures.</span>
- 00105 <span class="comment"> *****************************************************************************/</span>
- 00106 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPFXEffect.html#a5">Activate</a>();
- 00107
- 00108 <span class="comment">/*!***************************************************************************</span>
- 00109 <span class="comment"> @Function BuildUniformTable</span>
- 00110 <span class="comment"> @Output ppsUniforms pointer to uniform data array</span>
- 00111 <span class="comment"> @Output pnUniformCount pointer to number of uniforms</span>
- 00112 <span class="comment"> @Output pnUnknownUniformCount pointer to number of unknown uniforms</span>
- 00113 <span class="comment"> @Input psUniformSemantics pointer to uniform semantic data array</span>
- 00114 <span class="comment"> @Input nSemantics number of uniform semantics</span>
- 00115 <span class="comment"> @Output pReturnError error string</span>
- 00116 <span class="comment"> @Returns EPVRTError PVR_SUCCESS if succeeded</span>
- 00117 <span class="comment"> @Description Builds the uniform table from the semantics.</span>
- 00118 <span class="comment"> *****************************************************************************/</span>
- 00119 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="classCPVRTPFXEffect.html#a6">BuildUniformTable</a>(
- 00120 <a class="code" href="structSPVRTPFXUniform.html">SPVRTPFXUniform</a> ** <span class="keyword">const</span> ppsUniforms,
- 00121 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> * <span class="keyword">const</span> pnUniformCount,
- 00122 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> * <span class="keyword">const</span> pnUnknownUniformCount,
- 00123 <span class="keyword">const</span> <a class="code" href="structSPVRTPFXUniformSemantic.html">SPVRTPFXUniformSemantic</a> * <span class="keyword">const</span> psUniformSemantics,
- 00124 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nSemantics,
- 00125 <a class="code" href="classCPVRTString.html">CPVRTString</a> *pReturnError);
- 00126
- 00127 <span class="comment">/*!***************************************************************************</span>
- 00128 <span class="comment"> @Function GetTextureArray</span>
- 00129 <span class="comment"> @Output nCount number of textures</span>
- 00130 <span class="comment"> @Returns SPVRTPFXTexture* pointer to the texture data array</span>
- 00131 <span class="comment"> @Description Gets the texture data array.</span>
- 00132 <span class="comment"> *****************************************************************************/</span>
- 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> &nCount) <span class="keyword">const</span>;
- 00134
- 00135 <span class="comment">/*!***************************************************************************</span>
- 00136 <span class="comment"> @Function SetTexture</span>
- 00137 <span class="comment"> @Input nIdx texture number</span>
- 00138 <span class="comment"> @Input ui opengl texture handle</span>
- 00139 <span class="comment"> @Input u32flags texture flags</span>
- 00140 <span class="comment"> @Description Sets the textrue and applys the filtering.</span>
- 00141 <span class="comment"> *****************************************************************************/</span>
- 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);
- 00143
- 00144 <span class="comment">/*!***************************************************************************</span>
- 00145 <span class="comment"> @Function SetDefaultSemanticValue</span>
- 00146 <span class="comment"> @Input pszName name of uniform</span>
- 00147 <span class="comment"> @Input psDefaultValue pointer to default value</span>
- 00148 <span class="comment"> @Description Sets the dafault value for the uniform semantic.</span>
- 00149 <span class="comment"> *****************************************************************************/</span>
- 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);
- 00151
- 00152 };
- 00153
- 00154 <span class="preprocessor">#endif </span><span class="comment">/* _PVRTPFXPARSERAPI_H_ */</span>
- 00155
- 00156 <span class="comment">/*****************************************************************************</span>
- 00157 <span class="comment"> End of file (PVRTPFXParserAPI.h)</span>
- 00158 <span class="comment">*****************************************************************************/</span>
- 00159
- </pre></div><br>
- <br>
- <P align=left><FONT size=2><STRONG><A
- href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> ©
- 1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
- <hr>
- <address style="align: left;"><small><FONT color=f0f>
- Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
- </body>
- </html>
|