29 #include "RenderDevice.h" 30 #include "DeviceContext.h" 31 #include "SwapChain.h" 32 #include "HLSL2GLSLConverter.h" 34 #if defined(PLATFORM_WIN32) || defined(PLATFORM_UNIVERSAL_WINDOWS) 36 # define API_QUALIFIER 38 #elif defined(PLATFORM_ANDROID) || defined(PLATFORM_LINUX) 43 # define API_QUALIFIER __attribute__((visibility("default"))) 45 # define API_QUALIFIER __attribute__((visibility("default"))) 48 # define API_QUALIFIER 56 class IEngineFactoryOpenGL
59 virtual void CreateDeviceAndSwapChainGL(
const EngineCreationAttribs& CreationAttribs,
60 IRenderDevice **ppDevice,
61 IDeviceContext **ppImmediateContext,
62 const SwapChainDesc& SCDesc,
63 void *pNativeWndHandle,
67 ISwapChain **ppSwapChain ) = 0;
68 virtual void CreateHLSL2GLSLConverter(IHLSL2GLSLConverter **ppConverter) = 0;
70 virtual void AttachToActiveGLContext(
const EngineCreationAttribs& CreationAttribs,
71 IRenderDevice **ppDevice,
72 IDeviceContext **ppImmediateContext ) = 0;
80 #if defined(ENGINE_DLL) && (defined(PLATFORM_WIN32) || defined(PLATFORM_UNIVERSAL_WINDOWS)) 82 typedef Diligent::IEngineFactoryOpenGL* (*GetEngineFactoryOpenGLType)();
86 GetFactoryFunc =
nullptr;
87 std::string LibName =
"GraphicsEngineOpenGL_";
102 auto hModule = LoadLibraryA( LibName.c_str() );
103 if( hModule == NULL )
105 LOG_ERROR_MESSAGE(
"Failed to load ", LibName,
" library." );
109 GetFactoryFunc =
reinterpret_cast<GetEngineFactoryOpenGLType
>( GetProcAddress(hModule,
"GetEngineFactoryOpenGL") );
110 if( GetFactoryFunc == NULL )
112 LOG_ERROR_MESSAGE(
"Failed to load GetEngineFactoryOpenGL() from ", LibName,
" library." );
113 FreeLibrary( hModule );
123 Diligent::IEngineFactoryOpenGL* GetEngineFactoryOpenGL();
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
void LoadGraphicsEngineOpenGL(GetEngineFactoryOpenGLType &GetFactoryFunc)
Loads OpenGL-based engine implementation and exports factory functions.
Definition: RenderDeviceFactoryOpenGL.cpp:230