www.pudn.com > bookcode.rar > d3dfmtutils.h
//d3dfmtutils.h
//Ernest Pazera
//05OCT2001
//TGO-01-F
//Libs: d3d8.lib
//include guard
#ifndef __D3DFMTUTILS_H__
#define __D3DFMTUTILS_H__
//include d3d8 header
#include "d3d8.h"
//get string name for format
void GetFormatName ( D3DFORMAT Format , char* FormatName ) ;
//get bits for components
UINT GetFormatRBits ( D3DFORMAT Format ) ; //red
UINT GetFormatGBits ( D3DFORMAT Format ) ; //green
UINT GetFormatBBits ( D3DFORMAT Format ) ; //blue
UINT GetFormatABits ( D3DFORMAT Format ) ; //alpha
UINT GetFormatDBits ( D3DFORMAT Format ) ; //depth
UINT GetFormatSBits ( D3DFORMAT Format ) ; //stencil
//get bit masks for components
UINT GetFormatRMask ( D3DFORMAT Format ) ; //red
UINT GetFormatGMask ( D3DFORMAT Format ) ; //green
UINT GetFormatBMask ( D3DFORMAT Format ) ; //blue
UINT GetFormatAMask ( D3DFORMAT Format ) ; //alpha
UINT GetFormatDMask ( D3DFORMAT Format ) ; //depth
UINT GetFormatSMask ( D3DFORMAT Format ) ; //stencil
//include guard
#endif