Browse Source

Fixed issue #325.

Branimir Karadžić 10 years ago
parent
commit
d94c38b7ef
2 changed files with 9 additions and 8 deletions
  1. 2 2
      3rdparty/ocornut-imgui/imconfig.h
  2. 7 6
      src/renderer_d3d11.cpp

+ 2 - 2
3rdparty/ocornut-imgui/imconfig.h

@@ -19,8 +19,8 @@
 //#define IMGUI_API __declspec( dllimport )
 
 //---- Don't implement default handlers for Windows (so as not to link with OpenClipboard() and others Win32 functions)
-//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
-//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS
+#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
+#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS
 
 //---- Include imgui_user.inl at the end of imgui.cpp so you can include code that extends ImGui using its private data/functions.
 //#define IMGUI_INCLUDE_IMGUI_USER_INL

+ 7 - 6
src/renderer_d3d11.cpp

@@ -686,6 +686,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 				, NULL
 				, &m_swapChain
 				);
+			BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
+
+			DX_CHECK(m_factory->MakeWindowAssociation(g_bgfxHwnd, 0
+				| DXGI_MWA_NO_WINDOW_CHANGES
+				| DXGI_MWA_NO_ALT_ENTER
+				) );
 #else
 			hr = adapter->GetParent(IID_IDXGIFactory, (void**)&m_factory);
 			BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Unable to create Direct3D11 device.");
@@ -708,13 +714,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 				, &m_scd
 				, &m_swapChain
 				);
-#endif // BX_PLATFORM_WINRT
 			BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
-
-			DX_CHECK(m_factory->MakeWindowAssociation(g_bgfxHwnd, 0
-				| DXGI_MWA_NO_WINDOW_CHANGES
-				| DXGI_MWA_NO_ALT_ENTER
-				) );
+#endif // BX_PLATFORM_WINRT
 
 			m_numWindows = 1;