mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-25 04:38:29 +00:00
Pass command list in using ImGui_ImplDX12_NewFrame() instead of ImGui_ImplDX12_Init()
This commit is contained in:

committed by
Jefferson Montgomery

parent
f72b95d73f
commit
f6b6dace9e
@@ -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)
|
||||
|
Reference in New Issue
Block a user