@@ -91,11 +91,8 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
9191 case RENDER_DEVICE_TYPE_D3D11:
9292 {
9393 EngineD3D11CreateInfo EngineCI;
94- # if ENGINE_DLL
95- // Load the dll and import GetEngineFactoryD3D11() function
96- auto* GetEngineFactoryD3D11 = LoadGraphicsEngineD3D11();
97- # endif
98- auto* pFactoryD3D11 = GetEngineFactoryD3D11();
94+ // Load the dll and get the factory
95+ auto* pFactoryD3D11 = LoadAndGetEngineFactoryD3D11();
9996 pFactoryD3D11->CreateDeviceAndContextsD3D11(EngineCI, &m_pDevice, &m_pImmediateContext);
10097 Win32NativeWindow Window{hWnd};
10198 pFactoryD3D11->CreateSwapChainD3D11(m_pDevice, m_pImmediateContext, SCDesc,
@@ -105,13 +102,9 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
105102
106103 case RENDER_DEVICE_TYPE_D3D12:
107104 {
108- # if ENGINE_DLL
109- // Load the dll and import GetEngineFactoryD3D12() function
110- auto GetEngineFactoryD3D12 = LoadGraphicsEngineD3D12();
111- # endif
112105 EngineD3D12CreateInfo EngineCI;
113-
114- auto* pFactoryD3D12 = GetEngineFactoryD3D12 ();
106+ // Load the dll and get the factory
107+ auto* pFactoryD3D12 = LoadAndGetEngineFactoryD3D12 ();
115108 pFactoryD3D12->CreateDeviceAndContextsD3D12(EngineCI, &m_pDevice, &m_pImmediateContext);
116109 Win32NativeWindow Window{hWnd};
117110 pFactoryD3D12->CreateSwapChainD3D12(m_pDevice, m_pImmediateContext, SCDesc,
@@ -121,11 +114,8 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
121114
122115 case RENDER_DEVICE_TYPE_GL:
123116 {
124- # if EXPLICITLY_LOAD_ENGINE_GL_DLL
125- // Load the dll and import GetEngineFactoryOpenGL() function
126- auto GetEngineFactoryOpenGL = LoadGraphicsEngineOpenGL();
127- # endif
128- auto* pFactoryOpenGL = GetEngineFactoryOpenGL();
117+ // Load the dll and get the factory
118+ auto* pFactoryOpenGL = LoadAndGetEngineFactoryOpenGL();
129119
130120 EngineGLCreateInfo EngineCI;
131121 EngineCI.Window.hWnd = hWnd;
@@ -137,13 +127,9 @@ void InitializeDiligentEngine(HWND NativeWindowHandle)
137127
138128 case RENDER_DEVICE_TYPE_VULKAN:
139129 {
140- # if EXPLICITLY_LOAD_ENGINE_VK_DLL
141- // Load the dll and import GetEngineFactoryVk() function
142- auto GetEngineFactoryVk = LoadGraphicsEngineVk();
143- # endif
144130 EngineVkCreateInfo EngineCI;
145-
146- auto* pFactoryVk = GetEngineFactoryVk ();
131+ // Load the dll and get the factory
132+ auto* pFactoryVk = LoadAndGetEngineFactoryVk ();
147133 pFactoryVk->CreateDeviceAndContextsVk(EngineCI, &m_pDevice, &m_pImmediateContext);
148134 Win32NativeWindow Window{hWnd};
149135 pFactoryVk->CreateSwapChainVk(m_pDevice, m_pImmediateContext, SCDesc, Window, &m_pSwapChain);
0 commit comments