本文整理汇总了C++中StHandle::checkAqbsSupport方法的典型用法代码示例。如果您正苦于以下问题:C++ StHandle::checkAqbsSupport方法的具体用法?C++ StHandle::checkAqbsSupport怎么用?C++ StHandle::checkAqbsSupport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StHandle
的用法示例。
在下文中一共展示了StHandle::checkAqbsSupport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getInfo
bool StDXManager::getInfo(StDXInfo& theInfo,
const bool theForced) {
if(!theForced) {
if(ST_DX_HAS_CACHED_INFO) {
theInfo = ST_DX_CACHED_INFO;
return true;
}
}
const StStringUtfWide AQBS_TEST_CLASS = L"StTESTAqbsWin";
HINSTANCE anAppInst = GetModuleHandle(NULL);
WNDCLASSW aWinClass;
aWinClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
aWinClass.lpfnWndProc = (WNDPROC )aDummyWinProc;
aWinClass.cbClsExtra = 0;
aWinClass.cbWndExtra = 0;
aWinClass.hInstance = anAppInst;
aWinClass.hIcon = LoadIcon(anAppInst, L"A");
aWinClass.hCursor = LoadCursor(NULL, IDC_ARROW);
aWinClass.hbrBackground = NULL;
aWinClass.lpszMenuName = NULL;
aWinClass.lpszClassName = AQBS_TEST_CLASS.toCString(); // class name
if(RegisterClassW(&aWinClass) == 0) {
ST_DEBUG_LOG("Failed to RegisterClass '" + AQBS_TEST_CLASS.toUtf8() + "'");
return false;
}
HWND aWinHandle = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE | WS_EX_NOACTIVATE,
AQBS_TEST_CLASS.toCString(), L"StTESTAqbs Window",
WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
32, 32, 32, 32, NULL, NULL, anAppInst, NULL);
if(aWinHandle == NULL) {
ST_DEBUG_LOG("Failed to create 'StTESTAqbsWin' window (" + int(GetLastError()) + ")");
UnregisterClassW(AQBS_TEST_CLASS.toCString(), anAppInst);
return false;
}
StHandle<StDXManager> aDXManager = new StDXManager();
// test AQBS support
theInfo.hasAqbsSupport = aDXManager->checkAqbsSupport(aWinHandle);
// enumerate available adapters
if(aDXManager->myD3dLib != NULL) {
const UINT aD3dAdaptersNb = aDXManager->getAdapterCount();
D3DADAPTER_IDENTIFIER9 anAdapterInfo;
for(UINT anAdapterIter = 0; anAdapterIter < aD3dAdaptersNb; ++anAdapterIter) {
aDXManager->getAdapterIdentifier(anAdapterIter, 0, &anAdapterInfo);
if(anAdapterInfo.VendorId == ST_DX_VENDOR_AMD) {
theInfo.hasAmdAdapter = true;
} else if(anAdapterInfo.VendorId == ST_DX_VENDOR_NVIDIA) {
theInfo.hasNvAdapter = true;
}
}
}
// release resources
aDXManager.nullify();
DestroyWindow(aWinHandle);
UnregisterClass(AQBS_TEST_CLASS.toCString(), anAppInst);
// check NVIDIA Stereo enabled state
if(NvAPI_Initialize() == NVAPI_OK) {
NvU8 isStereoEnabled = FALSE;
NvAPI_Stereo_IsEnabled(&isStereoEnabled);
theInfo.hasNvStereoSupport = isStereoEnabled == TRUE;
}
//ST_DEBUG_LOG("DXInfo, AMD(" + int(theInfo.hasAmdAdapter) + "), AQBS(" + int(theInfo.hasAqbsSupport)
// + "); NVIDIA(" + int(theInfo.hasNvAdapter) + "), NvStereo(" + int(theInfo.hasNvStereoSupport) + ")");
// cache the state to avoid unnecessary calls
ST_DX_CACHED_INFO = theInfo;
ST_DX_HAS_CACHED_INFO = true;
return true;
}