| 566 | } |
| 567 | |
| 568 | void Renderer::Create() |
| 569 | { |
| 570 | TENLog("Creating DX11 renderer device...", LogLevel::Info); |
| 571 | |
| 572 | D3D_FEATURE_LEVEL levels[] = { D3D_FEATURE_LEVEL_11_0 }; |
| 573 | D3D_FEATURE_LEVEL featureLevel; |
| 574 | HRESULT res; |
| 575 | |
| 576 | if constexpr (DEBUG_BUILD) |
| 577 | { |
| 578 | res = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D11_CREATE_DEVICE_DEBUG, |
| 579 | levels, 1, D3D11_SDK_VERSION, &_device, &featureLevel, &_context); |
| 580 | } |
| 581 | else |
| 582 | { |
| 583 | res = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, NULL, |
| 584 | levels, 1, D3D11_SDK_VERSION, &_device, &featureLevel, &_context); |
| 585 | } |
| 586 | |
| 587 | Utils::throwIfFailed(res); |
| 588 | |
| 589 | // Collect adapter information. |
| 590 | CollectAdapterInfo(); |
| 591 | |
| 592 | // Initialize shader manager. |
| 593 | _shaders.Initialize(_device, _context); |
| 594 | } |
| 595 | |
| 596 | void Renderer::CollectAdapterInfo() |
| 597 | { |
no test coverage detected