30 #include "RenderDevice.h" 31 #include "DeviceContext.h" 32 #include "SwapChain.h" 34 #if PLATFORM_UNIVERSAL_WINDOWS && defined(ENGINE_DLL) 35 # include "StringTools.h" 41 class IEngineFactoryD3D12
44 virtual void CreateDeviceAndContextsD3D12(
const EngineD3D12Attribs& CreationAttribs,
45 IRenderDevice **ppDevice,
46 IDeviceContext **ppContexts,
47 Uint32 NumDeferredContexts) = 0;
49 virtual void AttachToD3D12Device(
void *pd3d12NativeDevice,
50 class ICommandQueueD3D12 *pCommandQueue,
51 const EngineD3D12Attribs& EngineAttribs,
52 IRenderDevice **ppDevice,
53 IDeviceContext **ppContexts,
54 Uint32 NumDeferredContexts) = 0;
56 virtual void CreateSwapChainD3D12( IRenderDevice *pDevice,
57 IDeviceContext *pImmediateContext,
58 const SwapChainDesc& SwapChainDesc,
59 void* pNativeWndHandle,
60 ISwapChain **ppSwapChain ) = 0;
70 typedef Diligent::IEngineFactoryD3D12* (*GetEngineFactoryD3D12Type)();
74 GetFactoryFunc =
nullptr;
75 std::string LibName =
"GraphicsEngineD3D12_";
91 auto hModule = LoadLibraryA(LibName.c_str());
92 #elif PLATFORM_UNIVERSAL_WINDOWS 93 auto hModule = LoadPackagedLibrary(Diligent::WidenString(LibName).c_str(), 0);
95 # error Unexpected platform 100 LOG_ERROR_MESSAGE(
"Failed to load ", LibName,
" library." );
104 GetFactoryFunc =
reinterpret_cast<GetEngineFactoryD3D12Type
>( GetProcAddress(hModule,
"GetEngineFactoryD3D12") );
105 if( GetFactoryFunc == NULL )
107 LOG_ERROR_MESSAGE(
"Failed to load GetEngineFactoryD3D12() from ", LibName,
" library." );
108 FreeLibrary( hModule );
116 Diligent::IEngineFactoryD3D12* GetEngineFactoryD3D12();
void LoadGraphicsEngineD3D12(GetEngineFactoryD3D12Type &GetFactoryFunc)
Loads Direct3D12-based engine implementation and exports factory functions.
Definition: RenderDeviceFactoryD3D12.cpp:393
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34