Pass command list in using ImGui_ImplDX12_NewFrame() instead of ImGui_ImplDX12_Init()

This commit is contained in:
Jefferson Montgomery
2017-09-24 14:43:37 -07:00
committed by Jefferson Montgomery
parent f72b95d73f
commit f6b6dace9e
3 changed files with 8 additions and 7 deletions

View File

@@ -629,13 +629,12 @@ void ImGui_ImplDX12_InvalidateDeviceObjects()
}
bool ImGui_ImplDX12_Init(void* hwnd, int num_frames_in_flight,
ID3D12Device* device, ID3D12GraphicsCommandList* command_list,
ID3D12Device* device,
D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle,
D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle)
{
g_hWnd = (HWND)hwnd;
g_pd3dDevice = device;
g_pd3dCommandList = command_list;
g_hFontSrvCpuDescHandle = font_srv_cpu_desc_handle;
g_hFontSrvGpuDescHandle = font_srv_gpu_desc_handle;
g_pFrameResources = new FrameResources [num_frames_in_flight];
@@ -697,11 +696,13 @@ void ImGui_ImplDX12_Shutdown()
g_frameIndex = UINT_MAX;
}
void ImGui_ImplDX12_NewFrame()
void ImGui_ImplDX12_NewFrame(ID3D12GraphicsCommandList* command_list)
{
if (!g_pPipelineState)
ImGui_ImplDX12_CreateDeviceObjects();
g_pd3dCommandList = command_list;
ImGuiIO& io = ImGui::GetIO();
// Setup display size (every frame to accommodate for window resizing)