Module dagon.resource.dds

DirectDraw Surface (DDS) loader.

Description

The dagon.resource.dds module defines the function for reading DDS files into GPU-ready texture buffers. The loader supports compressed formats (DXT1, DXT3, DXT5, BC4, BC5, BC6H, BC7, ASTC), cubemaps, mipmaps, and 3D/volume textures.

Functions

NameDescription
loadDDS(istrm, buffer) Loads a DDS file from an input stream into a texture buffer.
makeFourCC(ch0, ch1, ch2, ch3) Converts four ASCII characters to a FourCC code.
resourceFormatFromFourCC(fourCC) Maps a FourCC code to a DXGIFormat.
saveDDS(output, buffer) Saves a TextureBuffer to DDS file. Supports uncompressed and S3TC-compressed textures.
saveDDS(output, texture) Saves a texture to DDS file. Supports uncompressed and S3TC-compressed textures.

Structs

NameDescription
DDSColorKey Structure for color key information in DDS headers.
DDSHeader Structure describing the main DDS header.
DDSHeaderDXT10 Structure describing the DXT10 extended header (for newer DDS formats).
DDSPixelFormat Structure describing the pixel format in a DDS file.

Enums

NameDescription
D3D10ResourceDimension D3D10 resource dimensions.
D3D10ResourceMisc D3D10 miscellaneous flags.
DDPF DDS pixel format flags.
DDSCaps DDS capabilities.
DDSCaps2 DDS extended capabilities.
DDSHeaderFlags DDS header flags.