2
2
// This needs to be used along with a Platform Backend (e.g. Win32)
3
3
4
4
// Implemented features:
5
- // [X] Renderer: User texture binding. Use 'D3D12_GPU_DESCRIPTOR_HANDLE' as ImTextureID. Read the FAQ about
6
- // ImTextureID! [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices.
5
+ // [X] Renderer: User texture binding. Use 'D3D12_GPU_DESCRIPTOR_HANDLE' as ImTextureID. Read the FAQ about ImTextureID!
6
+ // [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices.
7
+ // [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
7
8
8
9
// Important: to compile on 32-bit systems, this backend requires code to be compiled with '#define ImTextureID ImU64'.
9
- // This is because we need ImTextureID to carry a 64-bit value and by default ImTextureID is defined as void*.
10
- // This define is set in the example .vcxproj file and need to be replicated in your app or by adding it to your
11
- // imconfig.h file.
10
+ // See imgui_impl_dx12.cpp file for details.
12
11
13
- // You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
14
- // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
15
- // Read online: https://github.com/ocornut/imgui/tree/master/docs
12
+ // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
13
+ // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
14
+ // Learn about Dear ImGui:
15
+ // - FAQ https://dearimgui.com/faq
16
+ // - Getting Started https://dearimgui.com/getting-started
17
+ // - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
18
+ // - Introduction, links and more at the top of imgui.cpp
16
19
17
20
#pragma once
18
- #include "imgui.h" // IMGUI_IMPL_API
21
+ #include "imgui.h" // IMGUI_IMPL_API
22
+ #ifndef IMGUI_DISABLE
23
+ #include <dxgiformat.h> // DXGI_FORMAT
19
24
20
25
struct ID3D12Device ;
21
26
struct ID3D12DescriptorHeap ;
22
27
struct ID3D12GraphicsCommandList ;
23
28
struct D3D12_CPU_DESCRIPTOR_HANDLE ;
24
29
struct D3D12_GPU_DESCRIPTOR_HANDLE ;
25
30
31
+ // Follow "Getting Started" link and check examples/ folder to learn about using backends!
32
+
26
33
// cmd_list is the command list that the implementation will use to render imgui draw lists.
27
34
// Before calling the render function, caller must prepare cmd_list by resetting it and setting the appropriate
28
35
// render target and descriptor heap that contains font_srv_cpu_desc_handle/font_srv_gpu_desc_handle.
29
- // font_srv_cpu_desc_handle and font_srv_gpu_desc_handle are handles to a single SRV descriptor to use for the internal
30
- // font texture.
31
- IMGUI_IMPL_API bool ImGui_ImplDX12_Init (
32
- ID3D12Device * apDevice , int aNumFramesInFlight , DXGI_FORMAT aRTVFormat , ID3D12DescriptorHeap * apSRVHeapDesc , D3D12_CPU_DESCRIPTOR_HANDLE aFontSRVDescCPU ,
33
- D3D12_GPU_DESCRIPTOR_HANDLE aFontSRVDescGPU );
34
- IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown ();
35
- IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame (ID3D12CommandQueue * apCommandQueue );
36
- IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData (ImDrawData * apDrawData , ID3D12GraphicsCommandList * apCommandLists );
36
+ // font_srv_cpu_desc_handle and font_srv_gpu_desc_handle are handles to a single SRV descriptor to use for the internal font texture.
37
+ IMGUI_IMPL_API bool ImGui_ImplDX12_Init (ID3D12Device * device , int num_frames_in_flight , DXGI_FORMAT rtv_format , ID3D12DescriptorHeap * cbv_srv_heap ,
38
+ D3D12_CPU_DESCRIPTOR_HANDLE font_srv_cpu_desc_handle , D3D12_GPU_DESCRIPTOR_HANDLE font_srv_gpu_desc_handle );
39
+ IMGUI_IMPL_API void ImGui_ImplDX12_Shutdown ();
40
+ IMGUI_IMPL_API void ImGui_ImplDX12_NewFrame (ID3D12CommandQueue * apCommandQueue );
41
+ IMGUI_IMPL_API void ImGui_ImplDX12_RenderDrawData (ImDrawData * draw_data , ID3D12GraphicsCommandList * graphics_command_list );
37
42
38
43
// Use if you want to reset your rendering device without losing Dear ImGui state.
39
- IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects ();
40
- IMGUI_IMPL_API bool ImGui_ImplDX12_CreateDeviceObjects (ID3D12CommandQueue * apCommandQueue );
44
+ IMGUI_IMPL_API void ImGui_ImplDX12_InvalidateDeviceObjects ();
45
+ IMGUI_IMPL_API bool ImGui_ImplDX12_CreateDeviceObjects (ID3D12CommandQueue * apCommandQueue );
46
+
47
+ #endif // #ifndef IMGUI_DISABLE
0 commit comments