From 8a0d3b9628d4b92a2d7d2a4a7b9424a745c76d9d Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 8 May 2016 11:49:21 +0200 Subject: [PATCH] Examples; DirectX10/11: Added comments about removing dependency on d3dcompiler DLL (#638) --- examples/directx10_example/imgui_impl_dx10.cpp | 6 ++++++ examples/directx10_example/main.cpp | 1 - examples/directx11_example/imgui_impl_dx11.cpp | 6 ++++++ examples/directx11_example/main.cpp | 1 - 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/directx10_example/imgui_impl_dx10.cpp b/examples/directx10_example/imgui_impl_dx10.cpp index 15dbed20..bccee87e 100644 --- a/examples/directx10_example/imgui_impl_dx10.cpp +++ b/examples/directx10_example/imgui_impl_dx10.cpp @@ -343,6 +343,12 @@ bool ImGui_ImplDX10_CreateDeviceObjects() if (g_pFontSampler) ImGui_ImplDX10_InvalidateDeviceObjects(); + // By using D3DCompile() from / d3dcompiler.lib, we introduce a dependency to a given version of d3dcompiler_XX.dll (see D3DCOMPILER_DLL_A) + // If you would like to use this DX11 sample code but remove this dependency you can: + // 1) compile once, save the compiled shader blobs into a file or source code and pass them to CreateVertexShader()/CreatePixelShader() [prefered solution] + // 2) use code to detect any version of the DLL and grab a pointer to D3DCompile from the DLL. + // See https://github.com/ocornut/imgui/pull/638 for sources and details. + // Create the vertex shader { static const char* vertexShader = diff --git a/examples/directx10_example/main.cpp b/examples/directx10_example/main.cpp index a418da9f..fb98cad1 100644 --- a/examples/directx10_example/main.cpp +++ b/examples/directx10_example/main.cpp @@ -5,7 +5,6 @@ #include "imgui_impl_dx10.h" #include #include -#include #define DIRECTINPUT_VERSION 0x0800 #include #include diff --git a/examples/directx11_example/imgui_impl_dx11.cpp b/examples/directx11_example/imgui_impl_dx11.cpp index d595e6c0..11f66f0e 100644 --- a/examples/directx11_example/imgui_impl_dx11.cpp +++ b/examples/directx11_example/imgui_impl_dx11.cpp @@ -345,6 +345,12 @@ bool ImGui_ImplDX11_CreateDeviceObjects() if (g_pFontSampler) ImGui_ImplDX11_InvalidateDeviceObjects(); + // By using D3DCompile() from / d3dcompiler.lib, we introduce a dependency to a given version of d3dcompiler_XX.dll (see D3DCOMPILER_DLL_A) + // If you would like to use this DX11 sample code but remove this dependency you can: + // 1) compile once, save the compiled shader blobs into a file or source code and pass them to CreateVertexShader()/CreatePixelShader() [prefered solution] + // 2) use code to detect any version of the DLL and grab a pointer to D3DCompile from the DLL. + // See https://github.com/ocornut/imgui/pull/638 for sources and details. + // Create the vertex shader { static const char* vertexShader = diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index a47e22d0..e3fe5aa7 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -4,7 +4,6 @@ #include #include "imgui_impl_dx11.h" #include -#include #define DIRECTINPUT_VERSION 0x0800 #include #include