|
|
@ -193,7 +193,8 @@ int main(int, char**)
|
|
|
|
g_pd3dCommandList->ResourceBarrier(1, &barrier);
|
|
|
|
g_pd3dCommandList->ResourceBarrier(1, &barrier);
|
|
|
|
|
|
|
|
|
|
|
|
// Render Dear ImGui graphics
|
|
|
|
// Render Dear ImGui graphics
|
|
|
|
g_pd3dCommandList->ClearRenderTargetView(g_mainRenderTargetDescriptor[backBufferIdx], (float*)&clear_color, 0, NULL);
|
|
|
|
const float clear_color_with_alpha[4] = { clear_color.x * clear_color.w, clear_color.y * clear_color.w, clear_color.z * clear_color.w, clear_color.w };
|
|
|
|
|
|
|
|
g_pd3dCommandList->ClearRenderTargetView(g_mainRenderTargetDescriptor[backBufferIdx], clear_color_with_alpha, 0, NULL);
|
|
|
|
g_pd3dCommandList->OMSetRenderTargets(1, &g_mainRenderTargetDescriptor[backBufferIdx], FALSE, NULL);
|
|
|
|
g_pd3dCommandList->OMSetRenderTargets(1, &g_mainRenderTargetDescriptor[backBufferIdx], FALSE, NULL);
|
|
|
|
g_pd3dCommandList->SetDescriptorHeaps(1, &g_pd3dSrvDescHeap);
|
|
|
|
g_pd3dCommandList->SetDescriptorHeaps(1, &g_pd3dSrvDescHeap);
|
|
|
|
ImGui_ImplDX12_RenderDrawData(ImGui::GetDrawData(), g_pd3dCommandList);
|
|
|
|
ImGui_ImplDX12_RenderDrawData(ImGui::GetDrawData(), g_pd3dCommandList);
|
|
|
@ -329,9 +330,11 @@ bool CreateDeviceD3D(HWND hWnd)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IDXGIFactory4* dxgiFactory = NULL;
|
|
|
|
IDXGIFactory4* dxgiFactory = NULL;
|
|
|
|
IDXGISwapChain1* swapChain1 = NULL;
|
|
|
|
IDXGISwapChain1* swapChain1 = NULL;
|
|
|
|
if (CreateDXGIFactory1(IID_PPV_ARGS(&dxgiFactory)) != S_OK ||
|
|
|
|
if (CreateDXGIFactory1(IID_PPV_ARGS(&dxgiFactory)) != S_OK)
|
|
|
|
dxgiFactory->CreateSwapChainForHwnd(g_pd3dCommandQueue, hWnd, &sd, NULL, NULL, &swapChain1) != S_OK ||
|
|
|
|
return false;
|
|
|
|
swapChain1->QueryInterface(IID_PPV_ARGS(&g_pSwapChain)) != S_OK)
|
|
|
|
if (dxgiFactory->CreateSwapChainForHwnd(g_pd3dCommandQueue, hWnd, &sd, NULL, NULL, &swapChain1) != S_OK)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (swapChain1->QueryInterface(IID_PPV_ARGS(&g_pSwapChain)) != S_OK)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
swapChain1->Release();
|
|
|
|
swapChain1->Release();
|
|
|
|
dxgiFactory->Release();
|
|
|
|
dxgiFactory->Release();
|
|
|
|