DirectX SDK

D3DX_SURFACEFORMAT

The D3DX_SURFACEFORMAT enumerated type defines the various types of surface formats that can be enumerated. All of the Direct3DX surface classes are represented here:

typedef enum _D3DX_SURFACEFORMAT {
  D3DX_SF_UNKNOWN    = 0,
  D3DX_SF_R8G8B8     = 1,
  D3DX_SF_A8R8G8B8   = 2,
  D3DX_SF_X8R8G8B8   = 3,
  D3DX_SF_R5G6B5     = 4,
  D3DX_SF_R5G5B5     = 5,
  D3DX_SF_PALETTE4   = 6,
  D3DX_SF_PALETTE8   = 7,
  D3DX_SF_A1R5G5B5   = 8,
  D3DX_SF_X4R4G4B4   = 9,
  D3DX_SF_A4R4G4B4   =10,
  D3DX_SF_L8         =11,
  D3DX_SF_A8L8       =12,
  D3DX_SF_U8V8       =13,
  D3DX_SF_U5V5L6     =14,
  D3DX_SF_U8V8L8     =15,
  D3DX_SF_UYVY       =16,
  D3DX_SF_YUY2       =17,
  D3DX_SF_DXT1       =18,
  D3DX_SF_DXT3       =19,
  D3DX_SF_DXT5       =20,
  D3DX_SF_R3G3B2     =21,
  D3DX_SF_A8         =22,
  D3DX_SF_TEXTUREMAX =23,
 
  D3DX_SF_Z16S0      =256,
  D3DX_SF_Z32S0      =257,
  D3DX_SF_Z15S1      =258,
  D3DX_SF_Z24S8      =259,
  D3DX_SF_S1Z15      =260,
  D3DX_SF_S8Z24      =261,
  D3DX_SF_DEPTHMAX   =262,
 
  D3DX_SF_FORCEMAX  = (DWORD)(-1)
} D3DX_SURFACEFORMAT;
D3DX_SF_UNKNOWN
The surface format is unknown.
D3DX_SF_R8G8B8
24-bit RGB pixel format.
D3DX_SF_A8R8G8B8
32-bit ARGB pixel format with alpha.
D3DX_SF_X8R8G8B8
32-bit RGB pixel format where 8 bits are reserved for each color.
D3DX_SF_R5G6B5
16-bit RGB pixel format.
D3DX_SF_R5G5B5
16-bit pixel format where 5 bits are reserved for color and 1 bit is reserved for transparency.
D3DX_SF_PALETTE4
The surface is 4-bit color indexed.
D3DX_SF_PALETTE8
The surface is 8-bit color indexed.
D3DX_SF_A1R5G5B5
16-bit pixel format where 5 bits are reserved for color and 1 bit is reserved for alpha (transparent texel).
D3DX_SF_X4R4G4B4
16-bit RGB pixel format where 4 bits are reserved for each color.
D3DX_SF_A4R4G4B4
16-bit ARGB pixel format.
D3DX_SF_L8
8-bit luminance-only.
D3DX_SF_A8L8
16-bit alpha-luminance.
D3DX_SF_U8V8
16-bit bump-map format.
D3DX_SF_U5V5L6
16-bit bump-map format with luminance.
D3DX_SF_U8V8L8
24-bit bump-map format with luminance.
D3DX_SF_UYVY
UYVY format (PC98 compliance).
D3DX_SF_YUY2
YUY2 format (PC98 compliance).
D3DX_SF_DXT1
S3 texture compression technique 1.
D3DX_SF_DXT3
S3 texture compression technique 3.
D3DX_SF_DXT5
S3 texture compression technique 5.
D3DX_SF_R3G3B2
8-bit RGB texture format.
D3DX_SF_A8
8-bit alpha-only.
D3DX_SF_TEXTUREMAX
Final texture format.
D3DX_SF_Z16S0
16-bit z-buffer bit depth.
D3DX_SF_Z32S0
32-bit z-buffer bit depth.
D3DX_SF_Z15S1
16-bit depth-buffer format with 1-bit reserved for the stencil buffer.
D3DX_SF_Z24S8
32-bit depth-buffer with 8 bits reserved for the stencil buffer.
D3DX_SF_S1Z15
16-bit depth buffer with 1 bit reserved for the stencil buffer (LSB).
D3DX_SF_S8Z24
32-bit depth-buffer with 8 bits reserved for the stencil buffer (LSB).
D3DX_SF_DEPTHMAX
Maximum depth-buffer pixel format.
D3DX_SF_FORCEMAX
Force the maximum.

Remarks

Note that there is no DDPIXELFORMAT structure in Direct3DX; rather the values of the D3DX_SURFACEFORMAT enumeration indicate the pixel format.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxcore.h.

See Also

D3DXGetMaxSurfaceFormats, D3DXGetSurfaceFormat