// initializes a direct draw struct
#define DDRAW_INIT_STRUCT(ddstruct) { memset(&ddstruct,0,sizeof(ddstruct)); ddstruct.dwSize=sizeof(ddstruct); }
// create IDirectDraw interface 7.0 object and test for error
if (FAILED(DirectDrawCreateEx(NULL, (void **)&lpdd, IID_IDirectDraw7, NULL)))
return(0);
DDCAPS hel_caps, hal_caps;
// initialize the structures
DDRAW_INIT_STRUCT(hel_caps);
DDRAW_INIT_STRUCT(hal_caps);
if (FAILED(lpdd->GetCaps(&hal_caps, &hel_caps)))
return(0);
if (hal_caps.dwCaps2 & DDCAPS2_COLORCONTROLPRIMARY)
OutputDebugString(_T("Supports primary surface contains color controls\n"));
if (hal_caps.dwCaps2 & DDCAPS2_COLORCONTROLOVERLAY)
OutputDebugString(_T("Supports overlay surface contains color controls\n"));
if (hal_caps.dwCaps2 & DDCAPS2_PRIMARYGAMMA)
OutputDebugString(_T("Supports loadable gamma ramps for the primary surface\n"));
同样的,你需要对DirectDraw有必要的了解,如果是使用GDI来负责图像的绘制,那么DirectX和DirectDraw的方案并不适合。