高效率 VMR-9 可建立 instances 數量是有限制的
It depends on the amount of video memory on your graphic card. How to determine the target users who can run your program? You can use the following code to retrieve the hardware information.
This code is a fixed version from the document posted by Jeremy Noring. The original version [1] has bugs and the GetCaps method will fail.
--------------------- code ---------------------
// 取得 video memory
IDirectDraw* pdd=0;
DDCAPS ddcHardwareCaps;
DDCAPS ddcEmulatedCaps;
hr=DirectDrawCreate(NULL,&pdd,NULL);
ddcHardwareCaps.dwSize=sizeof(DDCAPS); // fixed by Jing
ddcEmulatedCaps.dwSize=sizeof(DDCAPS);
hr=pdd->GetCaps(&ddcHardwareCaps,&ddcEmulatedCaps);
if(hr==DD_OK){
CString strmsg;
strmsg.Format(_T("Your video memory size =%d"),ddcHardwareCaps.dwVidMemTotal);
MessageBox(NULL,strmsg.GetBuffer(),_T("Info"),MB_OK);
}
pdd->Release();
--------------------- end of code ---------------------
Compiler Setup
1. You should install DirectX SDK
2. The ddraw.lib is needed and the location directory is at 磁碟機:\Program Files\Microsoft DirectX SDK (February 2007)\Lib\x86.
by Jing
References
[1] "Determining overlay capabilities," Jeremy Noring.
沒有留言:
張貼留言