Skip to content

DDSMetaData

Chuck Walbourn edited this page Aug 15, 2025 · 1 revision
DirectXTex

The DDSMetaData structure describes a (potentially complex) image surface.

struct DDSMetaData
{
    uint32_t    size;
    uint32_t    flags;
    uint32_t    fourCC;
    uint32_t    RGBBitCount;
    uint32_t    RBitMask;
    uint32_t    GBitMask;
    uint32_t    BBitMask;
    uint32_t    ABitMask;

    bool IsDX10() const;
}

Fields

  • size is DDPIXELFORMAT.dwSize which is ideally 32, but in some malformed files can be 0.

  • flags is DDPIXELFORMAT.dwFlags. See the DDPF_ flags in the Microsoft Docs.

  • fourCC is DDPIXELFORMAT.dwFourCC which is a "FourCC" code for many formats. In the case of the "DX10" extension header, this value is 0x30315844.

  • RGBBitCount is part of the DDPIXELFORMAT union and can be dwRGBBitCount, dwYUVBitCount, dwAlphaBitDepth, dwLuminanceBitCount, or dwBumpBitCount depending on flags.

  • RBitMask is part of the DDPIXELFORMAT union and can be dwRBitMask, dwYBitMask, dwLuminanceBitMask, or dwBumpDuBitMask.

  • GBitMask is part of the DDPIXELFORMAT union and can be dwGBitMask, dwUBitMask, or dwBumpDvBitMask.

  • BBitMask is part of the DDPIXELFORMAT union and can be dwBBitMask, dwVBitMask, or dwBumpLuminanceBitMask.

  • ABitMask is part of the DDPIXELFORMAT union and can be dwRGBAlphaBitMask, dwYUVAlphaBitMask, or dwLuminanceAlphaBitMask.

Use caution when examining the values of the DDSMetaData structure as they come directly from the file.

Methods

  • IsDX10 is a helper which does a test to see if it's the "DX10" extension header.

Exceptions

These methods are marked noexcept, and do not throw C++ exceptions.

Remarks

This will always be the "DX10" extended version for non-legacy DDS files which can be evaluated using the IsDX10 helper method.

Keep in mind that the original pixel format is subject to numerous conversions and options so the DXGI_FORMAT value returned should always be used to interpret the returned image instead of the original DDPIXELFORMAT structure information.

Further reading

DirectDraw (legacy) DDPIXELFORMAT

For Use

  • Universal Windows Platform apps
  • Windows desktop apps
  • Windows 11
  • Windows 10
  • Windows 8.1
  • Xbox One
  • Xbox Series X|S
  • Windows Subsystem for Linux

Architecture

  • x86
  • x64
  • ARM64

For Development

  • Visual Studio 2022
  • Visual Studio 2019 (16.11)
  • clang/LLVM v12 - v19
  • GCC 10.5, 11.4, 12.3, 13.3, 14.2
  • MinGW 12.2, 13.2
  • CMake 3.20

Related Projects

DirectXTex Rust bindings

DirectX Tool Kit for DirectX 11

DirectX Tool Kit for DirectX 12

DirectXMesh

DirectXMath

Tools

Test Suite

Content Exporter

DxCapsViewer

See also

DirectX Landing Page

Clone this wiki locally