Переглянути джерело

Examples: Win32+DX12: Fixed resizing main window, enabled debug layer. (#3087, #3115)

SergeyN 5 роки тому
батько
коміт
977ac53dd8
2 змінених файлів з 5 додано та 1 видалено
  1. 1 0
      docs/CHANGELOG.txt
  2. 4 1
      examples/example_win32_directx12/main.cpp

+ 1 - 0
docs/CHANGELOG.txt

@@ -94,6 +94,7 @@ Other Changes:
 - Backends: SDL: Added ImGui_ImplSDL2_InitForMetal() for API consistency (even though the function
   currently does nothing).
 - Backends: SDL: Fixed mapping for ImGuiKey_KeyPadEnter. (#3031) [@Davido71]
+- Examples: Win32+DX12: Fixed resizing main window, enabled debug layer. (#3087, #3115) [@sergeyn]
 - Examples: SDL+DX11: Fixed resizing main window. (#3057) [@joeslay]
 - Examples: Added SDL+Metal example application. (#3017) [@coding-jackalope]
 

+ 4 - 1
examples/example_win32_directx12/main.cpp

@@ -9,7 +9,9 @@
 #include <dxgi1_4.h>
 #include <tchar.h>
 
-//#define DX12_ENABLE_DEBUG_LAYER
+#ifdef _DEBUG
+#define DX12_ENABLE_DEBUG_LAYER
+#endif
 
 #ifdef DX12_ENABLE_DEBUG_LAYER
 #include <dxgidebug.h>
@@ -441,6 +443,7 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
     case WM_SIZE:
         if (g_pd3dDevice != NULL && wParam != SIZE_MINIMIZED)
         {
+            WaitForLastSubmittedFrame();
             ImGui_ImplDX12_InvalidateDeviceObjects();
             CleanupRenderTarget();
             ResizeSwapChain(hWnd, (UINT)LOWORD(lParam), (UINT)HIWORD(lParam));