| 153 | } |
| 154 | |
| 155 | void DeviceManager::CheckForSuitableOutput() |
| 156 | { |
| 157 | HRESULT hr = CreateDXGIFactory1(__uuidof(IDXGIFactory1), reinterpret_cast<void**>(&factory)); |
| 158 | if(FAILED(hr)) |
| 159 | throw Exception(L"Unable to create a DXGI 1.1 device.\n " |
| 160 | L"Make sure that your OS and driver support DirectX 11"); |
| 161 | |
| 162 | // Look for an adapter that supports D3D11 |
| 163 | IDXGIAdapter1Ptr curAdapter; |
| 164 | uint32 adapterIdx = 0; |
| 165 | LARGE_INTEGER umdVersion; |
| 166 | while(!adapter && SUCCEEDED(factory->EnumAdapters1(0, &adapter))) |
| 167 | if(SUCCEEDED(adapter->CheckInterfaceSupport(__uuidof(ID3D11Device), &umdVersion))) |
| 168 | adapter = curAdapter; |
| 169 | |
| 170 | if(!adapter) |
| 171 | throw Exception(L"Unable to locate a DXGI 1.1 adapter that supports a D3D11 device.\n" |
| 172 | L"Make sure that your OS and driver support DirectX 11"); |
| 173 | |
| 174 | // We'll just use the first output |
| 175 | DXCall(adapter->EnumOutputs(0, &output)); |
| 176 | } |
| 177 | |
| 178 | void DeviceManager::PrepareFullScreenSettings() |
| 179 | { |