@@ -47,6 +47,7 @@ extern "C" {
4747namespace fs = std::filesystem;
4848using namespace std ::literals;
4949
50+ extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
5051DEFINE_GUID (GUID_DEVINTERFACE_HID , 0x4D1E55B2L , 0xF16F , 0x11CF , 0x88 , 0xCB , 0x00 , 0x11 , 0x11 , 0x00 , 0x00 , 0x30 );
5152DEFINE_GUID (XUSB_INTERFACE_CLASS_GUID , 0xEC87F1E3 , 0xC13B , 0x4100 , 0xB5 , 0xF7 , 0x8B , 0x84 , 0xD5 , 0x42 , 0x60 , 0xCB );
5253
@@ -1122,7 +1123,7 @@ void REFramework::on_reset() {
11221123
11231124 if (m_initialized) {
11241125 // fixes text boxes not being able to receive input
1125- imgui::reset_keystates ();
1126+ // imgui::reset_keystates();
11261127 }
11271128
11281129 // Crashes if we don't release it at this point.
@@ -2386,8 +2387,17 @@ bool REFramework::init_d3d12() {
23862387 auto & bb = m_d3d12.get_rt (D3D12 ::RTV ::BACKBUFFER_0 );
23872388 auto bb_desc = bb->GetDesc ();
23882389
2389- if (!ImGui_ImplDX12_Init (device, swapchain_desc.BufferCount , bb_desc.Format , m_d3d12.srv_desc_heap .Get (),
2390- m_d3d12.get_cpu_srv (device, D3D12 ::SRV ::IMGUI_FONT_BACKBUFFER ), m_d3d12.get_gpu_srv (device, D3D12 ::SRV ::IMGUI_FONT_BACKBUFFER ))) {
2390+ ImGui_ImplDX12_InitInfo init_info{};
2391+ init_info.Device = device;
2392+ init_info.CommandQueue = g_framework->get_d3d12_hook ()->get_command_queue ();
2393+ init_info.NumFramesInFlight = swapchain_desc.BufferCount ;
2394+ init_info.RTVFormat = bb_desc.Format ;
2395+ init_info.DSVFormat = DXGI_FORMAT_UNKNOWN ;
2396+ init_info.SrvDescriptorHeap = m_d3d12.srv_desc_heap .Get ();
2397+ init_info.LegacySingleSrvCpuDescriptor = m_d3d12.get_cpu_srv (device, D3D12 ::SRV ::IMGUI_FONT_BACKBUFFER );
2398+ init_info.LegacySingleSrvGpuDescriptor = m_d3d12.get_gpu_srv (device, D3D12 ::SRV ::IMGUI_FONT_BACKBUFFER );
2399+
2400+ if (!ImGui_ImplDX12_Init (&init_info)) {
23912401 spdlog::error (" [D3D12] Failed to initialize ImGui." );
23922402 return false ;
23932403 }
@@ -2400,8 +2410,17 @@ bool REFramework::init_d3d12() {
24002410 auto & bb_vr = m_d3d12.get_rt (D3D12 ::RTV ::IMGUI );
24012411 auto bb_vr_desc = bb_vr->GetDesc ();
24022412
2403- if (!ImGui_ImplDX12_Init (device, swapchain_desc.BufferCount , bb_vr_desc.Format , m_d3d12.srv_desc_heap .Get (),
2404- m_d3d12.get_cpu_srv (device, D3D12 ::SRV ::IMGUI_FONT_VR ), m_d3d12.get_gpu_srv (device, D3D12 ::SRV ::IMGUI_FONT_VR ))) {
2413+ ImGui_ImplDX12_InitInfo init_info_vr{};
2414+ init_info_vr.Device = device;
2415+ init_info_vr.CommandQueue = g_framework->get_d3d12_hook ()->get_command_queue ();
2416+ init_info_vr.NumFramesInFlight = swapchain_desc.BufferCount ;
2417+ init_info_vr.RTVFormat = bb_vr_desc.Format ;
2418+ init_info_vr.DSVFormat = DXGI_FORMAT_UNKNOWN ;
2419+ init_info_vr.SrvDescriptorHeap = m_d3d12.srv_desc_heap .Get ();
2420+ init_info_vr.LegacySingleSrvCpuDescriptor = m_d3d12.get_cpu_srv (device, D3D12 ::SRV ::IMGUI_FONT_VR );
2421+ init_info_vr.LegacySingleSrvGpuDescriptor = m_d3d12.get_gpu_srv (device, D3D12 ::SRV ::IMGUI_FONT_VR );
2422+
2423+ if (!ImGui_ImplDX12_Init (&init_info_vr)) {
24052424 spdlog::error (" [D3D12] Failed to initialize ImGui." );
24062425 return false ;
24072426 }
0 commit comments