visual c++ - Directx11 SDK June(2010) Initialization on VC++ 2010 -
i hope i'm posting on right forum this!
recently have started programming directx 11 june (2010) sdk on vc++ 2010, on dell laptop nvidia geforce gt 630m gpu , intel hd 4000 chip.
one of things do, try , enumerate available adapters , outputs, , on. here's example:
idxgifactory1 *factory; createdxgifactory1(__uuidof(idxgifactory1), (lpvoid *)&factory); idxgiadapter *adapter; factory->enumadapters(0, &adapter); dxgi_adapter_desc desc; adapter->getdesc(&desc);
when run this, desc structure contains information intel hd chip, , not information gpu!
now, when open nvidia control panel, , select gpu preferred processor, , re-run sample, info gpu in desc - right! , also, when try enumerate outputs adapter, find there @ least one.
my question is: there way accomplish programmatically, in directx 11 sdk, don't have set setting in nvidia control panel?
i went through sdk code (for emptyproject11), , somehow "grab" gpu instead of intel chip. commented out code in winmain function, , inserted above code, , still grabbed gpu! project setup, environment variables, command line arguments, or....? mean how it!?!?!?
i appreciate insight matter.
thanks
you can run through of adapters presents , information on them looping through possible adapters using same function you're using:
hresult r = s_ok; unsigned int adapterindex = 0; std::unique_ptr<idxgiadapter, releasedirectx> dxgiadapter = null; // save result of enumadapters r, , check if it's s_ok while ( ( r = factory->enumadapters( adapterindex, &dxgiadapter ) ) == s_ok ) { ++adapterindex; /* work adapter here, particularly dxgi_adapter_desc */ }
usually, have choose default 1 automatically or enumerate of them , in kind of settings panel let user choose. other way use adapter description has video memory. it's not foolproof heuristic, it's 1 use "best" (used liberally) video card system. more not, however, default default reason.
good luck!
Comments
Post a Comment