PVRTShader_8h-source.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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>PVRTShader.h</h1><a href="PVRTShader_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 PVRTShader.h</span>
  26. 00004 <span class="comment"></span>
  27. 00005 <span class="comment"> @Title OGLES2/PVRTShader</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 ANSI compatible</span>
  34. 00012 <span class="comment"></span>
  35. 00013 <span class="comment"> @Description Shader handling for OpenGL ES 2.0</span>
  36. 00014 <span class="comment"></span>
  37. 00015 <span class="comment">******************************************************************************/</span>
  38. 00016 <span class="preprocessor">#ifndef _PVRTSHADER_H_</span>
  39. 00017 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTSHADER_H_</span>
  40. 00018 <span class="preprocessor"></span>
  41. 00019 <span class="preprocessor">#include "<a class="code" href="PVRTContext_8h.html">PVRTContext.h</a>"</span>
  42. 00020 <span class="preprocessor">#include "../PVRTString.h"</span>
  43. 00021 <span class="preprocessor">#include "../PVRTError.h"</span>
  44. 00022
  45. 00023 <span class="comment">/*!***************************************************************************</span>
  46. 00024 <span class="comment"> @Function PVRTShaderLoadSourceFromMemory</span>
  47. 00025 <span class="comment"> @Input pszShaderCode shader source code</span>
  48. 00026 <span class="comment"> @Input Type type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER)</span>
  49. 00027 <span class="comment"> @Output pObject the resulting shader object</span>
  50. 00028 <span class="comment"> @Output pReturnError the error message if it failed</span>
  51. 00029 <span class="comment"> @Input aszDefineArray Array of defines to be pre-appended to shader string</span>
  52. 00030 <span class="comment"> @Input uiDefArraySize Size of the define array</span>
  53. 00031 <span class="comment"> @Return PVR_SUCCESS on success and PVR_FAIL on failure (also fills the str string)</span>
  54. 00032 <span class="comment"> @Description Loads a shader source code into memory and compiles it.</span>
  55. 00033 <span class="comment"> It also pre-appends the array of defines that have been passed in</span>
  56. 00034 <span class="comment"> to the source code before compilation.</span>
  57. 00035 <span class="comment">*****************************************************************************/</span>
  58. 00036 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTShader_8h.html#a0">PVRTShaderLoadSourceFromMemory</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* pszShaderCode,
  59. 00037 <span class="keyword">const</span> GLenum Type,
  60. 00038 GLuint* <span class="keyword">const</span> pObject,
  61. 00039 <a class="code" href="classCPVRTString.html">CPVRTString</a>* <span class="keyword">const</span> pReturnError,
  62. 00040 <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span>* aszDefineArray=0, GLuint uiDefArraySize=0);
  63. 00041
  64. 00042 <span class="comment">/*!***************************************************************************</span>
  65. 00043 <span class="comment"> @Function PVRTShaderLoadBinaryFromMemory</span>
  66. 00044 <span class="comment"> @Input ShaderData shader compiled binary data</span>
  67. 00045 <span class="comment"> @Input Size size of shader binary data in bytes</span>
  68. 00046 <span class="comment"> @Input Type type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER)</span>
  69. 00047 <span class="comment"> @Input Format shader binary format</span>
  70. 00048 <span class="comment"> @Output pObject the resulting shader object</span>
  71. 00049 <span class="comment"> @Output pReturnError the error message if it failed</span>
  72. 00050 <span class="comment"> @Return PVR_SUCCESS on success and PVR_FAIL on failure (also fills the str string)</span>
  73. 00051 <span class="comment"> @Description Takes a shader binary from memory and passes it to the GL.</span>
  74. 00052 <span class="comment">*****************************************************************************/</span>
  75. 00053 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTShader_8h.html#a1">PVRTShaderLoadBinaryFromMemory</a>( <span class="keyword">const</span> <span class="keywordtype">void</span>* <span class="keyword">const</span> ShaderData,
  76. 00054 <span class="keyword">const</span> size_t Size,
  77. 00055 <span class="keyword">const</span> GLenum Type,
  78. 00056 <span class="keyword">const</span> GLenum Format,
  79. 00057 GLuint* <span class="keyword">const</span> pObject,
  80. 00058 <a class="code" href="classCPVRTString.html">CPVRTString</a>* <span class="keyword">const</span> pReturnError);
  81. 00059
  82. 00060 <span class="comment">/*!***************************************************************************</span>
  83. 00061 <span class="comment"> @Function PVRTShaderLoadFromFile</span>
  84. 00062 <span class="comment"> @Input pszBinFile binary shader filename</span>
  85. 00063 <span class="comment"> @Input pszSrcFile source shader filename</span>
  86. 00064 <span class="comment"> @Input Type type of shader (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER)</span>
  87. 00065 <span class="comment"> @Input Format shader binary format, or 0 for source shader</span>
  88. 00066 <span class="comment"> @Output pObject the resulting shader object</span>
  89. 00067 <span class="comment"> @Output pReturnError the error message if it failed</span>
  90. 00068 <span class="comment"> @Input pContext Context</span>
  91. 00069 <span class="comment"> @Input aszDefineArray Array of defines to be pre-appended to shader string</span>
  92. 00070 <span class="comment"> @Input uiDefArraySize Size of the define array</span>
  93. 00071 <span class="comment"> @Return PVR_SUCCESS on success and PVR_FAIL on failure (also fills pReturnError)</span>
  94. 00072 <span class="comment"> @Description Loads a shader file into memory and passes it to the GL. </span>
  95. 00073 <span class="comment"> It also passes defines that need to be pre-appended to the shader before compilation.</span>
  96. 00074 <span class="comment">*****************************************************************************/</span>
  97. 00075 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTShader_8h.html#a2">PVRTShaderLoadFromFile</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> pszBinFile,
  98. 00076 <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> pszSrcFile,
  99. 00077 <span class="keyword">const</span> GLenum Type,
  100. 00078 <span class="keyword">const</span> GLenum Format,
  101. 00079 GLuint* <span class="keyword">const</span> pObject,
  102. 00080 <a class="code" href="classCPVRTString.html">CPVRTString</a>* <span class="keyword">const</span> pReturnError,
  103. 00081 <span class="keyword">const</span> <a class="code" href="structSPVRTContext.html">SPVRTContext</a>* <span class="keyword">const</span> pContext=0,
  104. 00082 <span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keyword">const</span>* aszDefineArray=0, GLuint uiDefArraySize=0);
  105. 00083
  106. 00084 <span class="comment">/*!***************************************************************************</span>
  107. 00085 <span class="comment"> @Function PVRTCreateProgram</span>
  108. 00086 <span class="comment"> @Output pProgramObject the created program object</span>
  109. 00087 <span class="comment"> @Input VertexShader the vertex shader to link</span>
  110. 00088 <span class="comment"> @Input FragmentShader the fragment shader to link</span>
  111. 00089 <span class="comment"> @Input pszAttribs an array of attribute names</span>
  112. 00090 <span class="comment"> @Input i32NumAttribs the number of attributes to bind</span>
  113. 00091 <span class="comment"> @Output pReturnError the error message if it failed</span>
  114. 00092 <span class="comment"> @Returns PVR_SUCCESS on success, PVR_FAIL if failure</span>
  115. 00093 <span class="comment"> @Description Links a shader program.</span>
  116. 00094 <span class="comment">*****************************************************************************/</span>
  117. 00095 <a class="code" href="PVRTError_8h.html#a5">EPVRTError</a> <a class="code" href="PVRTShader_8h.html#a3">PVRTCreateProgram</a>( GLuint* <span class="keyword">const</span> pProgramObject,
  118. 00096 <span class="keyword">const</span> GLuint VertexShader,
  119. 00097 <span class="keyword">const</span> GLuint FragmentShader,
  120. 00098 <span class="keyword">const</span> <span class="keywordtype">char</span>** <span class="keyword">const</span> pszAttribs,
  121. 00099 <span class="keyword">const</span> <span class="keywordtype">int</span> i32NumAttribs,
  122. 00100 <a class="code" href="classCPVRTString.html">CPVRTString</a>* <span class="keyword">const</span> pReturnError);
  123. 00101
  124. 00102 <span class="preprocessor">#endif</span>
  125. 00103 <span class="preprocessor"></span>
  126. 00104 <span class="comment">/*****************************************************************************</span>
  127. 00105 <span class="comment"> End of file (PVRTShader.h)</span>
  128. 00106 <span class="comment">*****************************************************************************/</span>
  129. 00107
  130. </pre></div><br>
  131. <br>
  132. <P align=left><FONT size=2><STRONG><A
  133. href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> ©
  134. 1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
  135. <hr>
  136. <address style="align: left;"><small><FONT color=f0f>
  137. Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
  138. </body>
  139. </html>