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.

readme.txt 9.9 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. glBitmap by Steffen Xonna aka Lossy eX (2003-2008)
  2. http://www.opengl24.de/index.php?cat=header&file=glbitmap
  3. modified by Delphi OpenGL Community (http://delphigl.com/) (2013)
  4. ------------------------------------------------------------
  5. The contents of this project are used with permission, subject to
  6. the Mozilla Public License Version 1.1 (the "License"); you may
  7. not use this file except in compliance with the License. You may
  8. obtain a copy of the License at
  9. http://www.mozilla.org/MPL/MPL-1.1.html
  10. ------------------------------------------------------------
  11. The glBitmap is a Delphi/FPC unit that contains several wrapper classes
  12. to manage OpenGL texture objects. Below you can find a list of the main
  13. functionality of this classes:
  14. - load texture data from file (e.g. BMP, TGA, DDS, PNG, JPEG, ...)
  15. - load texture data from several other image objects (e.g. TBitmap, TLazIntfImage, SDL Surface)
  16. - save texture data to file (e.g. BMP, TGA, DDS, PNG, JPEG, ...)
  17. - save texture data to several other image objects (e.g. TBitmap, TLazIntfImage, SDL Surface)
  18. - support for many texture formats (e.g. RGB8, BGR8, RGBA8, BGRA8, ...)
  19. - manage texture properties (e.g. Filter, Clamp, Mipmap, ...)
  20. - upload texture data to video card
  21. - download texture data from video card
  22. - manipulate texture data (e.g. add alpha, remove alpha, convert to other format, switch RGB, ...)
  23. check glBitmapConf.default.inc to configure the glBitmap.pas to fit your needs
  24. ------------------------------------------------------------
  25. History
  26. 20-11-2013
  27. - refactoring of the complete library
  28. - glBitmap is managed by git, so this history is not maintenanced any longer
  29. 21-03-2010
  30. - The define GLB_DELPHI dosn't check versions anymore. If you say you are using delphi
  31. then it's your problem if that isn't true. This prevents the unit for incompatibility
  32. with newer versions of Delphi.
  33. - Problems with D2009+ resolved (Thanks noeska and all i forgot)
  34. - GetPixel isn't set if you are loading textures inside the constructor (Thanks Wilson)
  35. 10-08-2008
  36. - AddAlphaFromglBitmap used the custom pointer instead the imagedatapointer (Thanks Wilson)
  37. - Additional Datapointer for functioninterface now has the name CustomData
  38. 24-07-2008
  39. - AssigneAlphaToBitmap overwrites his own palette (Thanks Wilson)
  40. - If you load an texture from an file the property Filename will be set to the name of the file
  41. - Three new properties to attach custom data to the Texture objects
  42. - CustomName (free for use string)
  43. - CustomNameW (free for use widestring)
  44. - CustomDataPointer (free for use pointer to attach other objects or complex structures)
  45. 27-05-2008
  46. - RLE TGAs loaded much faster
  47. 26-05-2008
  48. - fixed some problem with reading RLE TGAs.
  49. 21-05-2008
  50. - function clone now only copys data if it's assigned and now it also copies the ID
  51. - it seems that lazarus dont like comments in comments.
  52. 01-05-2008
  53. - It's possible to set the id of the texture
  54. - define GLB_NO_NATIVE_GL deactivated by default
  55. 27-04-2008
  56. - Now supports the following libraries
  57. - SDL and SDL_image
  58. - libPNG
  59. - libJPEG
  60. - Linux compatibillity via free pascal compatibility (delphi sources optional)
  61. - BMPs now loaded manuel
  62. - Large restructuring
  63. - Property DataPtr now has the name Data
  64. - Functions are more flexible between RGB(A) and BGR(A). RGB can be saved as Bitmap and will be saved as BGR
  65. - Unused Depth removed
  66. - Function FreeData to freeing image data added
  67. 24-10-2007
  68. - ImageID flag of TGAs was ignored. (Thanks Zwoetzen)
  69. 15-11-2006
  70. - Function SetBorderColor implemented (only used by opengl if wrap is set to GL_CLAMP_TO_BORDER)
  71. - Function AddAlphaFromValue implemented to use an fixed Value as Alphachannel
  72. - Function ReadOpenGLExtension is now only intern
  73. 29-06-2006
  74. - pngimage now disabled by default like all other versions.
  75. 26-06-2006
  76. - Setting up an anisotropic filter of 0 isnt allowed by nvidia (Thanks Ogridi)
  77. 22-06-2006
  78. - Fixed some Problem with Delphi 5
  79. - Now uses the newest version of pngimage. Makes saving pngs much easier.
  80. 22-03-2006
  81. - Property IsCompressed and Size removed. Not really supported by Spec (Thanks Ogridi)
  82. 09-03-2006
  83. - Internal Format ifDepth8 added
  84. - function GrabScreen now supports all uncompressed formats
  85. 31-01-2006
  86. - AddAlphaFromglBitmap implemented
  87. 29-12-2005
  88. - LoadFromResource and LoadFromResourceId now needs an Instance and an ResourceType (for ID)
  89. 28-12-2005
  90. - Width, Height and Depth internal changed to TglBitmapPixelPosition.
  91. property Width, Height, Depth are still existing and new property Dimension are avail
  92. 11-12-2005
  93. - Added native OpenGL Support. Breaking the dglOpenGL "barrier".
  94. 19-10-2005
  95. - Added function GrabScreen to class TglBitmap2D
  96. 18-10-2005
  97. - Added support to Save images
  98. - Added function Clone to Clone Instance
  99. 11-10-2005
  100. - Functions now works with Cardinals for each channel. Up to 32 Bits per channel.
  101. Usefull for Future
  102. - Several speed optimizations
  103. 09-10-2005
  104. - Internal structure change. Loading of TGA, PNG and DDS improved.
  105. Data, format and size will now set directly with SetDataPtr.
  106. - AddFunc now works with all Types of Images and Formats
  107. - Some Funtions moved to Baseclass TglBitmap
  108. 06-10-2005
  109. - Added Support to decompress DXT3 and DXT5 compressed Images.
  110. - Added Mapping to convert data from one format into an other.
  111. 05-10-2005
  112. - Added method ConvertTo in Class TglBitmap2D. Method allows to convert every
  113. supported Input format (supported by GetPixel) into any uncompresed Format
  114. - Added Support to decompress DXT1 compressed Images.
  115. - SwapColors replaced by ConvertTo
  116. 04-10-2005
  117. - Added Support for compressed DDSs
  118. - Added new internal formats (DXT1, DXT3, DXT5)
  119. 29-09-2005
  120. - Parameter Components renamed to InternalFormat
  121. 23-09-2005
  122. - Some AllocMem replaced with GetMem (little speed change)
  123. - better exception handling. Better protection from memory leaks.
  124. 22-09-2005
  125. - Added support for Direct Draw Surfaces (.DDS) (uncompressed images only)
  126. - Added new internal formats (RGB8, RGBA8, RGBA4, RGB5A1, RGB10A2, R5G6B5)
  127. 07-09-2005
  128. - Added support for Grayscale textures
  129. - Added internal formats (Alpha, Luminance, LuminanceAlpha, BGR8, BGRA8)
  130. 10-07-2005
  131. - Added support for GL_VERSION_2_0
  132. - Added support for GL_EXT_texture_filter_anisotropic
  133. 04-07-2005
  134. - Function FillWithColor fills the Image with one Color
  135. - Function LoadNormalMap added
  136. 30-06-2005
  137. - ToNormalMap allows to Create an NormalMap from the Alphachannel
  138. - ToNormalMap now supports Sobel (nmSobel) function.
  139. 29-06-2005
  140. - support for RLE Compressed RGB TGAs added
  141. 28-06-2005
  142. - Class TglBitmapNormalMap added to support Normalmap generation
  143. - Added function ToNormalMap in class TglBitmap2D to genereate normal maps from textures.
  144. 3 Filters are supported. (4 Samples, 3x3 and 5x5)
  145. 16-06-2005
  146. - Method LoadCubeMapClass removed
  147. - LoadCubeMap returnvalue is now the Texture paramter. Such as LoadTextures
  148. - virtual abstract method GenTexture in class TglBitmap now is protected
  149. 12-06-2005
  150. - now support DescriptionFlag in LoadTga. Allows vertical flipped images to be loaded as normal
  151. 10-06-2005
  152. - little enhancement for IsPowerOfTwo
  153. - TglBitmap1D.GenTexture now tests NPOT Textures
  154. 06-06-2005
  155. - some little name changes. All properties or function with Texture in name are
  156. now without texture in name. We have allways texture so we dosn't name it.
  157. 03-06-2005
  158. - GenTexture now tests if texture is NPOT and NPOT-Texture are supported or
  159. TextureTarget is GL_TEXTURE_RECTANGLE. Else it raised an exception.
  160. 02-06-2005
  161. - added support for GL_ARB_texture_rectangle, GL_EXT_texture_rectangle and GL_NV_texture_rectangle
  162. 25-04-2005
  163. - Function Unbind added
  164. - call of SetFilter or SetTextureWrap if TextureID exists results in setting properties to opengl texture.
  165. 21-04-2005
  166. - class TglBitmapCubeMap added (allows to Create Cubemaps)
  167. 29-03-2005
  168. - Added Support for PNG Images. (http://pngdelphi.sourceforge.net/)
  169. To Enable png's use the define pngimage
  170. 22-03-2005
  171. - New Functioninterface added
  172. - Function GetPixel added
  173. 27-11-2004
  174. - Property BuildMipMaps renamed to MipMap
  175. 21-11-2004
  176. - property Name removed.
  177. - BuildMipMaps is now a set of 3 values. None, GluBuildMipmaps and SGIS_generate_mipmap
  178. 22-05-2004
  179. - property name added. Only used in glForms!
  180. 26-11-2003
  181. - property FreeDataAfterGenTexture is now available as default (default = true)
  182. - BuildMipmaps now implemented in TglBitmap1D (i've forgotten it)
  183. - function MoveMemory replaced with function Move (little speed change)
  184. - several calculations stored in variables (little speed change)
  185. 29-09-2003
  186. - property BuildMipsMaps added (default = true)
  187. if BuildMipMaps isn't set GenTextures uses glTexImage[12]D else it use gluBuild[12]dMipmaps
  188. - property FreeDataAfterGenTexture added (default = true)
  189. if FreeDataAfterGenTexture is set the texturedata were deleted after the texture was generated.
  190. - parameter DisableOtherTextureUnits of Bind removed
  191. - parameter FreeDataAfterGeneration of GenTextures removed
  192. 12-09-2003
  193. - TglBitmap dosn't delete data if class was destroyed (fixed)
  194. 09-09-2003
  195. - Bind now enables TextureUnits (by params)
  196. - GenTextures can leave data (by param)
  197. - LoadTextures now optimal
  198. 03-09-2003
  199. - Performance optimization in AddFunc
  200. - procedure Bind moved to subclasses
  201. - Added new Class TglBitmap1D to support real OpenGL 1D Textures
  202. 19-08-2003
  203. - Texturefilter and texturewrap now also as defaults
  204. Minfilter = GL_LINEAR_MIPMAP_LINEAR
  205. Magfilter = GL_LINEAR
  206. Wrap(str) = GL_CLAMP_TO_EDGE
  207. - Added new format tfCompressed to create a compressed texture.
  208. - propertys IsCompressed, TextureSize and IsResident added
  209. IsCompressed and TextureSize only contains data from level 0
  210. 18-08-2003
  211. - Added function AddFunc to add PerPixelEffects to Image
  212. - LoadFromFunc now based on AddFunc
  213. - Invert now based on AddFunc
  214. - SwapColors now based on AddFunc
  215. 16-08-2003
  216. - Added function FlipHorz
  217. 15-08-2003
  218. - Added function LaodFromFunc to create images with function
  219. - Added function FlipVert
  220. - Added internal format RGB(A) if GL_EXT_bgra or OpenGL 1.2 isn't supported
  221. 29-07-2003
  222. - Added Alphafunctions to calculate alpha per function
  223. - Added Alpha from ColorKey using alphafunctions
  224. 28-07-2003
  225. - First full functionally Version of glBitmap
  226. - Support for 24Bit and 32Bit TGA Pictures added
  227. 25-07-2003
  228. - begin of programming