30 #include "EngineD3D11Attribs.h" 31 #include "RenderDevice.h" 32 #include "DeviceContext.h" 33 #include "SwapChain.h" 35 #if PLATFORM_UNIVERSAL_WINDOWS && defined(ENGINE_DLL) 36 # include "StringTools.h" 42 class IEngineFactoryD3D11
45 virtual void CreateDeviceAndContextsD3D11(
const EngineD3D11Attribs& EngineAttribs,
46 IRenderDevice **ppDevice,
47 IDeviceContext **ppContexts,
48 Uint32 NumDeferredContexts ) = 0;
50 virtual void CreateSwapChainD3D11( IRenderDevice *pDevice,
51 IDeviceContext *pImmediateContext,
52 const SwapChainDesc& SCDesc,
53 void* pNativeWndHandle,
54 ISwapChain **ppSwapChain ) = 0;
56 virtual void AttachToD3D11Device(
void *pd3d11NativeDevice,
57 void *pd3d11ImmediateContext,
58 const EngineD3D11Attribs& EngineAttribs,
59 IRenderDevice **ppDevice,
60 IDeviceContext **ppContexts,
61 Uint32 NumDeferredContexts) = 0;
70 typedef Diligent::IEngineFactoryD3D11* (*GetEngineFactoryD3D11Type)();
74 GetFactoryFunc =
nullptr;
75 std::string LibName =
"GraphicsEngineD3D11_";
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 99 LOG_ERROR_MESSAGE(
"Failed to load ", LibName,
" library." );
103 GetFactoryFunc =
reinterpret_cast<GetEngineFactoryD3D11Type
>( GetProcAddress(hModule,
"GetEngineFactoryD3D11") );
104 if( GetFactoryFunc == NULL )
106 LOG_ERROR_MESSAGE(
"Failed to load GetEngineFactoryD3D11() from ", LibName,
" library." );
107 FreeLibrary( hModule );
115 Diligent::IEngineFactoryD3D11* GetEngineFactoryD3D11();
void LoadGraphicsEngineD3D11(GetEngineFactoryD3D11Type &GetFactoryFunc)
Loads Direct3D11-based engine implementation and exports factory functions.
Definition: RenderDeviceFactoryD3D11.cpp:339
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34