mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 06:06:35 +00:00
Examples: DirectX10, DirectX11: Removed seemingly unnecessary bunch of rasterizer state creation code.
This commit is contained in:
parent
834bfe4af5
commit
f4633d09ac
@ -63,27 +63,6 @@ HRESULT CreateDeviceD3D(HWND hWnd)
|
||||
if (D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, createDeviceFlags, D3D10_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice) != S_OK)
|
||||
return E_FAIL;
|
||||
|
||||
// Setup rasterizer
|
||||
{
|
||||
D3D10_RASTERIZER_DESC RSDesc;
|
||||
memset(&RSDesc, 0, sizeof(D3D10_RASTERIZER_DESC));
|
||||
RSDesc.FillMode = D3D10_FILL_SOLID;
|
||||
RSDesc.CullMode = D3D10_CULL_NONE;
|
||||
RSDesc.FrontCounterClockwise = FALSE;
|
||||
RSDesc.DepthBias = 0;
|
||||
RSDesc.SlopeScaledDepthBias = 0.0f;
|
||||
RSDesc.DepthBiasClamp = 0;
|
||||
RSDesc.DepthClipEnable = TRUE;
|
||||
RSDesc.ScissorEnable = TRUE;
|
||||
RSDesc.AntialiasedLineEnable = FALSE;
|
||||
RSDesc.MultisampleEnable = (sd.SampleDesc.Count > 1) ? TRUE : FALSE;
|
||||
|
||||
ID3D10RasterizerState* pRState = NULL;
|
||||
g_pd3dDevice->CreateRasterizerState(&RSDesc, &pRState);
|
||||
g_pd3dDevice->RSSetState(pRState);
|
||||
pRState->Release();
|
||||
}
|
||||
|
||||
CreateRenderTarget();
|
||||
|
||||
return S_OK;
|
||||
|
@ -65,27 +65,6 @@ HRESULT CreateDeviceD3D(HWND hWnd)
|
||||
if (D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, createDeviceFlags, featureLevelArray, 1, D3D11_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice, &featureLevel, &g_pd3dDeviceContext) != S_OK)
|
||||
return E_FAIL;
|
||||
|
||||
// Setup rasterizer
|
||||
{
|
||||
D3D11_RASTERIZER_DESC RSDesc;
|
||||
memset(&RSDesc, 0, sizeof(D3D11_RASTERIZER_DESC));
|
||||
RSDesc.FillMode = D3D11_FILL_SOLID;
|
||||
RSDesc.CullMode = D3D11_CULL_NONE;
|
||||
RSDesc.FrontCounterClockwise = FALSE;
|
||||
RSDesc.DepthBias = 0;
|
||||
RSDesc.SlopeScaledDepthBias = 0.0f;
|
||||
RSDesc.DepthBiasClamp = 0;
|
||||
RSDesc.DepthClipEnable = TRUE;
|
||||
RSDesc.ScissorEnable = TRUE;
|
||||
RSDesc.AntialiasedLineEnable = FALSE;
|
||||
RSDesc.MultisampleEnable = (sd.SampleDesc.Count > 1) ? TRUE : FALSE;
|
||||
|
||||
ID3D11RasterizerState* pRState = NULL;
|
||||
g_pd3dDevice->CreateRasterizerState(&RSDesc, &pRState);
|
||||
g_pd3dDeviceContext->RSSetState(pRState);
|
||||
pRState->Release();
|
||||
}
|
||||
|
||||
CreateRenderTarget();
|
||||
|
||||
return S_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user