Reputation: 1617
I am writing a program in C++ using directx 11 for my graphics. My laptop has a light weight intel graphics card that is used to extend my battery life and is supposed to only be used for "lightweight" graphics. I have another much more powerful video card installed also.
I am wondering how to specify which video card to use in directx? Is there a way when I am creating the device to specify which card to use within my code?
Thanks
Upvotes: 3
Views: 4154
Reputation: 9
I had a similar issue. I haven't tried upgrading my graphics card drivers yet, but I will when I get my computer plugged back into the internet.
Here's what I found and how I "solved" (aka jury-rigged) my problem:
Symptoms:
Solution:
There may be a prettier way to do this, but that's what my "problem" was. Obviously it would be better if my card supported the full DX11 system, but it's not a bad safeguard in case a user has similar issues. At least I can programmatically identify the issue.
Upvotes: 0
Reputation: 8953
If your card is some intel/nvidia combination, you have two options:
-First is set the nvidia card as prefered device (in nvidia control panel, manage 3d settings, Global/Program settings, change the preffered graphics processor.
Another way using code, is to enumerate adapters with DXGI, and try to get device with restricted feature level (CreateDevice will fail if not available, and most intel cards are 10.1)
http://msdn.microsoft.com/en-us/library/windows/desktop/bb174538(v=vs.85).aspx to enum adapters.
Then try to create device with D3D_FEATURE_LEVEL_11_0 only for each adapter, only the one supporting it will be created.
Upvotes: 2