如题
解决方案 »
- 如何在单文档界面上,单击鼠标左键画一圆,再次单击鼠标左键,重复画圆,所有的圆都不消失?
- 如何实现Directx中的位图旋转?急!!!!
- "C++" 英语怎么读??
- 请问:怎样实现让一个对话框自动关闭?
- 如何用vc实现ip和域名的相互转换,急!!!请指教
- 怪事:CryptAcquireContext(&hProv,NULL,NULL,PROV_RSA_FULL,0)返回错误代码:2,这时候咋会是这个错误???
- 向各位大侠请教
- VC.net中能不能生成makefile??????
- 寻找vc下,模版类的例程
- MFC Ribbon 在功能区插入按钮问题
- 有谁知道如何实现会发光的文字啊?
- 终于脱掉裤衩当猩猩了,散分!
HRESULT ddrval; ddrval = CoCreateInstance(CLSID_DirectDraw,
NULL, CLSCTX_ALL, IID_IDirectDraw2, (void**)&lpdd);
if(!FAILED(ddrval))
{
ddrval = IDirectDraw2_Initialize(lpdd, NULL);
} DDCAPS ddcaps; ddcaps.dwSize = sizeof DDCAPS;
lpdd->GetCaps(&ddcaps, NULL); lpdd->Release(); DWORD dwMem = ddcaps.dwVidMemTotal; CoUninitialize();
不过为什么得到是32397824转为M是30.89M,而不是32M?
LPDDCAPS lpDDDriverCaps,
LPDDCAPS lpDDHELCaps
);
Parameters
lpDDDriverCaps
Address of a DDCAPS structure that will be filled with the capabilities of the hardware, as reported by the device driver. Set this parameter to NULL if device driver capabilities are not to be retrieved.
lpDDHELCaps
Address of a DDCAPS structure that will be filled with the capabilities of the HEL. Set this parameter to NULL if HEL capabilities are not to be retrieved.
lpdd->GetCaps(NULL,&ddcaps);来获取,第一种方式得到的会有误差以下是DDCAPS的定义,找你感兴趣的信息typedef struct _DDCAPS {
DWORD dwSize;
DWORD dwCaps; // driver-specific caps
DWORD dwCaps2; // more driver-specific caps
DWORD dwCKeyCaps; // color key caps
DWORD dwFXCaps; // stretching and effects caps
DWORD dwFXAlphaCaps; // alpha caps
DWORD dwPalCaps; // palette caps
DWORD dwSVCaps; // stereo vision caps
DWORD dwAlphaBltConstBitDepths; // alpha bit-depth members
DWORD dwAlphaBltPixelBitDepths; // .
DWORD dwAlphaBltSurfaceBitDepths; // .
DWORD dwAlphaOverlayConstBitDepths; // .
DWORD dwAlphaOverlayPixelBitDepths; // .
DWORD dwAlphaOverlaySurfaceBitDepths; // .
DWORD dwZBufferBitDepths; // Z-buffer bit depth
DWORD dwVidMemTotal; // total video memory
DWORD dwVidMemFree; // total free video memory
DWORD dwMaxVisibleOverlays; // maximum visible overlays
DWORD dwCurrVisibleOverlays; // overlays currently visible
DWORD dwNumFourCCCodes; // number of supported FOURCC codes
DWORD dwAlignBoundarySrc; // overlay alignment restrictions
DWORD dwAlignSizeSrc; // .
DWORD dwAlignBoundaryDest; // .
DWORD dwAlignSizeDest; // .
DWORD dwAlignStrideAlign; // stride alignment
DWORD dwRops[DD_ROP_SPACE]; // supported raster ops
DDSCAPS ddsCaps; // general surface caps
DWORD dwMinOverlayStretch; // overlay stretch factors
DWORD dwMaxOverlayStretch; // .
DWORD dwMinLiveVideoStretch; // obsolete
DWORD dwMaxLiveVideoStretch; // .
DWORD dwMinHwCodecStretch; // .
DWORD dwMaxHwCodecStretch; // .
DWORD dwReserved1; // reserved
DWORD dwReserved2; // .
DWORD dwReserved3; // .
DWORD dwSVBCaps; // system-to-video blit related caps
DWORD dwSVBCKeyCaps; // .
DWORD dwSVBFXCaps; // .
DWORD dwSVBRops[DD_ROP_SPACE]; // .
DWORD dwVSBCaps; // video-to-system blit related caps
DWORD dwVSBCKeyCaps; // .
DWORD dwVSBFXCaps; // .
DWORD dwVSBRops[DD_ROP_SPACE]; // .
DWORD dwSSBCaps; // system-to-system blit related caps
DWORD dwSSBCKeyCaps; // .
DWORD dwSSBCFXCaps; // .
DWORD dwSSBRops[DD_ROP_SPACE]; // .
DWORD dwMaxVideoPorts; // maximum number of live video ports
DWORD dwCurrVideoPorts; // current number of live video ports
DWORD dwSVBCaps2; // additional system-to-video blit caps
DWORD dwNLVBCaps; // nonlocal-to-local video memory blit caps
DWORD dwNLVBCaps2; // .
DWORD dwNLVBCKeyCaps; // .
DWORD dwNLVBFXCaps; // .
DWORD dwNLVBRops[DD_ROP_SPACE];// .
DWORD dwReserved4; // reserved
DWORD dwReserved5; // .
DWORD dwReserved6; // .
} DDCAPS,FAR* LPDDCAPS;