You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

280 lines
14 KiB

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
  2. <html>
  3. <head>
  4. <title>glBitmap: Class TglBitmap2D</title>
  5. <meta name="generator" content="PasDoc 0.13.0">
  6. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
  7. <link rel="StyleSheet" type="text/css" href="pasdoc.css">
  8. </head>
  9. <body>
  10. <table class="container"><tr><td class="navigation">
  11. <p><a href="AllUnits.html" class="navigation">Units</a></p><p><a href="ClassHierarchy.html" class="navigation">Class Hierarchy</a></p><p><a href="AllClasses.html" class="navigation">Classes, Interfaces, Objects and Records</a></p><p><a href="AllTypes.html" class="navigation">Types</a></p><p><a href="AllVariables.html" class="navigation">Variables</a></p><p><a href="AllConstants.html" class="navigation">Constants</a></p><p><a href="AllFunctions.html" class="navigation">Functions and Procedures</a></p><p><a href="AllIdentifiers.html" class="navigation">Identifiers</a></p></td><td class="content">
  12. <a name="TglBitmap2D"></a><h1 class="cio">Class TglBitmap2D</h1>
  13. <table class="sections wide_list">
  14. <tr>
  15. <td><a class="section" href="#PasDoc-Description">Description</a></td><td><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></td><td><a class="section" href="#PasDoc-Fields">Fields</a></td><td><a class="section" href="#PasDoc-Methods">Methods</a></td><td><a class="section" href="#PasDoc-Properties">Properties</a></td></tr></table>
  16. <a name="PasDoc-Description"></a><h2 class="unit">Unit</h2>
  17. <p class="unitlink">
  18. <a href="glBitmap.html">glBitmap</a></p>
  19. <h2 class="declaration">Declaration</h2>
  20. <p class="declaration">
  21. <code>type TglBitmap2D = class(<a class="normal" href="glBitmap.TglBitmap.html">TglBitmap</a>)</code></p>
  22. <h2 class="description">Description</h2>
  23. <p>
  24. wrapper class for 2-dimensional textures (OpenGL target = GL_TEXTURE_2D)</p>
  25. <a name="PasDoc-Hierarchy"></a><h2 class="hierarchy">Hierarchy</h2>
  26. <ul class="hierarchy"><li class="ancestor">TObject</li>
  27. <li class="ancestor"><a class="normal" href="glBitmap.TglBitmap.html">TglBitmap</a></li>
  28. <li class="thisitem">TglBitmap2D</li></ul><h2 class="overview">Overview</h2>
  29. <a name="PasDoc-Fields"></a><h3 class="summary">Fields</h3>
  30. <table class="summary wide_list">
  31. <tr class="list">
  32. <td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
  33. <td class="itemcode"><code><b><a href="glBitmap.TglBitmap2D.html#fLines">fLines</a></b>: array of PByte;</code></td>
  34. </tr>
  35. </table>
  36. <a name="PasDoc-Methods"></a><h3 class="summary">Methods</h3>
  37. <table class="summary wide_list">
  38. <tr class="list">
  39. <td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
  40. <td class="itemcode"><code>function <b><a href="glBitmap.TglBitmap2D.html#GetScanline">GetScanline</a></b>(const aIndex: Integer): Pointer;</code></td>
  41. </tr>
  42. <tr class="list2">
  43. <td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
  44. <td class="itemcode"><code>procedure <b><a href="glBitmap.TglBitmap2D.html#SetDataPointer">SetDataPointer</a></b>(var aData: PByte; const aFormat: <a href="glBitmap.html#TglBitmapFormat">TglBitmapFormat</a>; const aWidth: Integer = - 1; const aHeight: Integer = - 1); override;</code></td>
  45. </tr>
  46. <tr class="list">
  47. <td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
  48. <td class="itemcode"><code>procedure <b><a href="glBitmap.TglBitmap2D.html#UploadData">UploadData</a></b>(const aTarget: GLenum);</code></td>
  49. </tr>
  50. <tr class="list2">
  51. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  52. <td class="itemcode"><code>procedure <b><a href="glBitmap.TglBitmap2D.html#AfterConstruction">AfterConstruction</a></b>; override;</code></td>
  53. </tr>
  54. <tr class="list">
  55. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  56. <td class="itemcode"><code>procedure <b><a href="glBitmap.TglBitmap2D.html#GrabScreen">GrabScreen</a></b>(const aTop, aLeft, aRight, aBottom: Integer; const aFormat: <a href="glBitmap.html#TglBitmapFormat">TglBitmapFormat</a>);</code></td>
  57. </tr>
  58. <tr class="list2">
  59. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  60. <td class="itemcode"><code>procedure <b><a href="glBitmap.TglBitmap2D.html#GenTexture">GenTexture</a></b>(const aTestTextureSize: Boolean = true); override;</code></td>
  61. </tr>
  62. <tr class="list">
  63. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  64. <td class="itemcode"><code>function <b><a href="glBitmap.TglBitmap2D.html#FlipHorz">FlipHorz</a></b>: Boolean; override;</code></td>
  65. </tr>
  66. <tr class="list2">
  67. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  68. <td class="itemcode"><code>function <b><a href="glBitmap.TglBitmap2D.html#FlipVert">FlipVert</a></b>: Boolean; override;</code></td>
  69. </tr>
  70. <tr class="list">
  71. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  72. <td class="itemcode"><code>procedure <b><a href="glBitmap.TglBitmap2D.html#GenerateNormalMap">GenerateNormalMap</a></b>(const aFunc: <a href="glBitmap.html#TglBitmapNormalMapFunc">TglBitmapNormalMapFunc</a> = nm3x3; const aScale: Single = 2; const aUseAlpha: Boolean = false);</code></td>
  73. </tr>
  74. </table>
  75. <a name="PasDoc-Properties"></a><h3 class="summary">Properties</h3>
  76. <table class="summary wide_list">
  77. <tr class="list">
  78. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  79. <td class="itemcode"><code>property <b><a href="glBitmap.TglBitmap2D.html#Width">Width</a></b>;</code></td>
  80. </tr>
  81. <tr class="list2">
  82. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  83. <td class="itemcode"><code>property <b><a href="glBitmap.TglBitmap2D.html#Height">Height</a></b>;</code></td>
  84. </tr>
  85. <tr class="list">
  86. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  87. <td class="itemcode"><code>property <b><a href="glBitmap.TglBitmap2D.html#Scanline">Scanline</a></b>[constaIndex:Integer]: Pointer read <a href="glBitmap.TglBitmap2D.html#GetScanline">GetScanline</a>;</code></td>
  88. </tr>
  89. </table>
  90. <h2 class="description">Description</h2>
  91. <h3 class="detail">Fields</h3>
  92. <table class="detail wide_list">
  93. <tr class="list">
  94. <td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
  95. <td class="itemcode"><a name="fLines"></a><code><b>fLines</b>: array of PByte;</code></td>
  96. </tr>
  97. <tr><td colspan="2">
  98. <p>
  99. array to store scanline entry points in</p>
  100. </td></tr>
  101. </table>
  102. <h3 class="detail">Methods</h3>
  103. <table class="detail wide_list">
  104. <tr class="list">
  105. <td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
  106. <td class="itemcode"><a name="GetScanline"></a><code>function <b>GetScanline</b>(const aIndex: Integer): Pointer;</code></td>
  107. </tr>
  108. <tr><td colspan="2">
  109. <p>
  110. get a specific scanline </p>
  111. <h6 class="description_section">Parameters</h6>
  112. <dl class="parameters">
  113. <dt>aIndex</dt>
  114. <dd>index of the scanline to return</dd>
  115. </dl>
  116. <h6 class="description_section">Returns</h6>
  117. <p class="return">scanline at position aIndex or <code>Nil</code></p></td></tr>
  118. </table>
  119. <table class="detail wide_list">
  120. <tr class="list">
  121. <td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
  122. <td class="itemcode"><a name="SetDataPointer"></a><code>procedure <b>SetDataPointer</b>(var aData: PByte; const aFormat: <a href="glBitmap.html#TglBitmapFormat">TglBitmapFormat</a>; const aWidth: Integer = - 1; const aHeight: Integer = - 1); override;</code></td>
  123. </tr>
  124. <tr><td colspan="2">
  125. <p>
  126. set data pointer of texture data </p>
  127. <h6 class="description_section">Parameters</h6>
  128. <dl class="parameters">
  129. <dt>aData</dt>
  130. <dd>pointer to new texture data (be carefull, aData could be freed by this function)</dd>
  131. <dt>aFormat</dt>
  132. <dd>format of the data stored at aData</dd>
  133. <dt>aWidth</dt>
  134. <dd>width of the texture data</dd>
  135. <dt>aHeight</dt>
  136. <dd>height of the texture data</dd>
  137. </dl>
  138. </td></tr>
  139. </table>
  140. <table class="detail wide_list">
  141. <tr class="list">
  142. <td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
  143. <td class="itemcode"><a name="UploadData"></a><code>procedure <b>UploadData</b>(const aTarget: GLenum);</code></td>
  144. </tr>
  145. <tr><td colspan="2">
  146. <p>
  147. upload the texture data to video card </p>
  148. <h6 class="description_section">Parameters</h6>
  149. <dl class="parameters">
  150. <dt>aTarget</dt>
  151. <dd>target o upload data to (e.g. GL_TEXTURE_2D)</dd>
  152. <dt>aBuildWithGlu</dt>
  153. <dd>use glu functions to build mipmaps</dd>
  154. </dl>
  155. </td></tr>
  156. </table>
  157. <table class="detail wide_list">
  158. <tr class="list">
  159. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  160. <td class="itemcode"><a name="AfterConstruction"></a><code>procedure <b>AfterConstruction</b>; override;</code></td>
  161. </tr>
  162. <tr><td colspan="2">
  163. <p>
  164. this method is called after constructor and initializes the object</p>
  165. </td></tr>
  166. </table>
  167. <table class="detail wide_list">
  168. <tr class="list">
  169. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  170. <td class="itemcode"><a name="GrabScreen"></a><code>procedure <b>GrabScreen</b>(const aTop, aLeft, aRight, aBottom: Integer; const aFormat: <a href="glBitmap.html#TglBitmapFormat">TglBitmapFormat</a>);</code></td>
  171. </tr>
  172. <tr><td colspan="2">
  173. <p>
  174. copy a part of the frame buffer top the texture </p>
  175. <h6 class="description_section">Parameters</h6>
  176. <dl class="parameters">
  177. <dt>aTop</dt>
  178. <dd>topmost pixel to copy</dd>
  179. <dt>aLeft</dt>
  180. <dd>leftmost pixel to copy</dd>
  181. <dt>aRight</dt>
  182. <dd>rightmost pixel to copy</dd>
  183. <dt>aBottom</dt>
  184. <dd>bottommost pixel to copy</dd>
  185. <dt>aFormat</dt>
  186. <dd>format to store data in</dd>
  187. </dl>
  188. </td></tr>
  189. </table>
  190. <table class="detail wide_list">
  191. <tr class="list">
  192. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  193. <td class="itemcode"><a name="GenTexture"></a><code>procedure <b>GenTexture</b>(const aTestTextureSize: Boolean = true); override;</code></td>
  194. </tr>
  195. <tr><td colspan="2">
  196. <p>
  197. generate texture (create texture object if not exist, set texture parameters and upload data) </p>
  198. <h6 class="description_section">Parameters</h6>
  199. <dl class="parameters">
  200. <dt>aTestTextureSize</dt>
  201. <dd>check the size of the texture and throw exception if something is wrong</dd>
  202. </dl>
  203. </td></tr>
  204. </table>
  205. <table class="detail wide_list">
  206. <tr class="list">
  207. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  208. <td class="itemcode"><a name="FlipHorz"></a><code>function <b>FlipHorz</b>: Boolean; override;</code></td>
  209. </tr>
  210. <tr><td colspan="2">
  211. <p>
  212. flip texture horizontally </p>
  213. <h6 class="description_section">Returns</h6>
  214. <p class="return"><code>True</code> on success, <code>False</code> otherwise</p></td></tr>
  215. </table>
  216. <table class="detail wide_list">
  217. <tr class="list">
  218. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  219. <td class="itemcode"><a name="FlipVert"></a><code>function <b>FlipVert</b>: Boolean; override;</code></td>
  220. </tr>
  221. <tr><td colspan="2">
  222. <p>
  223. flip texture vertically </p>
  224. <h6 class="description_section">Returns</h6>
  225. <p class="return"><code>True</code> on success, <code>False</code> otherwise</p></td></tr>
  226. </table>
  227. <table class="detail wide_list">
  228. <tr class="list">
  229. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  230. <td class="itemcode"><a name="GenerateNormalMap"></a><code>procedure <b>GenerateNormalMap</b>(const aFunc: <a href="glBitmap.html#TglBitmapNormalMapFunc">TglBitmapNormalMapFunc</a> = nm3x3; const aScale: Single = 2; const aUseAlpha: Boolean = false);</code></td>
  231. </tr>
  232. <tr><td colspan="2">
  233. <p>
  234. create normal map from texture data </p>
  235. <h6 class="description_section">Parameters</h6>
  236. <dl class="parameters">
  237. <dt>aFunc</dt>
  238. <dd>normal map function to generate normalmap with</dd>
  239. <dt>aScale</dt>
  240. <dd>scale of the normale stored in the normal map</dd>
  241. <dt>aUseAlpha</dt>
  242. <dd>generate normalmap from alpha channel data (if present)</dd>
  243. </dl>
  244. </td></tr>
  245. </table>
  246. <h3 class="detail">Properties</h3>
  247. <table class="detail wide_list">
  248. <tr class="list">
  249. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  250. <td class="itemcode"><a name="Width"></a><code>property <b>Width</b>;</code></td>
  251. </tr>
  252. <tr><td colspan="2">
  253. <p>
  254. actual width of the texture</p>
  255. </td></tr>
  256. </table>
  257. <table class="detail wide_list">
  258. <tr class="list">
  259. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  260. <td class="itemcode"><a name="Height"></a><code>property <b>Height</b>;</code></td>
  261. </tr>
  262. <tr><td colspan="2">
  263. <p>
  264. actual height of the texture</p>
  265. </td></tr>
  266. </table>
  267. <table class="detail wide_list">
  268. <tr class="list">
  269. <td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
  270. <td class="itemcode"><a name="Scanline"></a><code>property <b>Scanline</b>[constaIndex:Integer]: Pointer read <a href="glBitmap.TglBitmap2D.html#GetScanline">GetScanline</a>;</code></td>
  271. </tr>
  272. <tr><td colspan="2">
  273. <p>
  274. scanline to access texture data directly</p>
  275. </td></tr>
  276. </table>
  277. <hr noshade size="1"><span class="appinfo"><em>Generated by <a href="http://pasdoc.sourceforge.net/">PasDoc 0.13.0</a> on 2014-12-21 15:05:48</em>
  278. </span>
  279. </td></tr></table></body></html>