Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Unit CastleTextureImages
Description
Handling of images for textures. This unit is not OpenGL-specific, it should be suitable for all 3D libraries. See GLImage for OpenGL-specific handling of textures and other images.
Texture is any TEncodedImage instance. This includes not only a traditional 2D/3D matrix of pixels represented as TCastleImage, but also a compressed texture, TS3TCImage. Moreover, a texture may have mipmaps defined — they are stored inside TDDSImage instance (that contains a list of TEncodedImage).
Since not everything can really deal with such flexible definition of a texture, we decided to separate some routines specifically for textures. For example, you have LoadTextureImage to load full texture information — contrast this with LoadImage routine in Images unit, that only returns TCastleImage (a "normal" way to deal with image data).
Uses
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Constants
Description
Functions and Procedures
function LoadTextureImage(const FileName: string; out DDS: TDDSImage): TEncodedImage; overload; |
Load image suitable for a texture. This will load image to memory formats supported by common 3D libraries (like OpenGL), for example it will never return TRGBFloatImage (although OpenGL may support it, but we cannot be sure at this point). It may return S3TC encoded image.
If the image comes from a DDS file, it will also return it (if not, DDS returned will be Nil ). This allows you to e.g. use texture mipmaps recorded there. Note that DDS.OwnsFirstImage is set to False , so you can always safely free everything by simple FreeAndNil(Image); FreeAndNil(DDS); .
Overloaded version without DDS parameter assumes you're not interested in this information (still it handles DDS files of course, it just doesn't return DDS object instance).
|
function LoadTextureImage(const FileName: string): TEncodedImage; overload; |
|
Constants
Generated by PasDoc 0.12.1 on 2013-02-04 20:26:52
|