Skip to content

Commit

Permalink
xrRender_R4: allowed creation in DX10 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Jul 1, 2019
1 parent 3f04a11 commit 04d137e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/Layers/xrRenderDX10/dx10HW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ void CHW::CreateDevice(SDL_Window* m_sdlWnd)
D3D_FEATURE_LEVEL featureLevels[] =
{
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0
};

R = D3D11CreateDevice(m_pAdapter,
Expand Down
22 changes: 11 additions & 11 deletions src/Layers/xrRenderPC_R4/r2_test_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ bool TestDX11Present()
}

// Create window
HWND hWnd = CreateWindow("TestDX11WindowClass", "", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
HWND hWnd = CreateWindow("TestDX11WindowClass", "", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);

if (!hWnd)
{
Expand All @@ -45,14 +45,20 @@ bool TestDX11Present()
sd.SampleDesc.Quality = 0;
sd.Windowed = TRUE;

D3D_FEATURE_LEVEL pFeatureLevels[] = {D3D_FEATURE_LEVEL_11_0};
D3D_FEATURE_LEVEL featureLevels[] =
{
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0
};
D3D_FEATURE_LEVEL FeatureLevel;

ID3D11Device* pd3dDevice = NULL;
ID3D11DeviceContext* pContext = NULL;
IDXGISwapChain* pSwapChain = NULL;

HRESULT hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, pFeatureLevels, 1, D3D11_SDK_VERSION,
HRESULT hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0,
featureLevels, sizeof(featureLevels) / sizeof(featureLevels[0]), D3D11_SDK_VERSION,
&sd, &pSwapChain, &pd3dDevice, &FeatureLevel, &pContext);

if (FAILED(hr))
Expand All @@ -70,11 +76,5 @@ bool TestDX11Present()

BOOL xrRender_test_hw()
{
// CHW _HW;
// HRESULT hr;
//_HW.CreateD3D () ;
// hr = _HW.m_pAdapter->CheckInterfaceSupport(__uuidof(ID3DDevice), 0);
//_HW.DestroyD3D () ;

return TestDX11Present(); // SUCCEEDED(hr);
return TestDX11Present();
}

0 comments on commit 04d137e

Please sign in to comment.