diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-11-03 17:47:23 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-11-03 17:47:23 +0000 |
| commit | d8abce94cd08cb73527a9f9e1f12969ba3681ee6 (patch) | |
| tree | d3cde96264cf2f86137cba39d9c61936c5915d8a /Graphics/GraphicsEngineOpenGL | |
| parent | Enabled Vulkan backend build on Linux (diff) | |
| download | DiligentCore-d8abce94cd08cb73527a9f9e1f12969ba3681ee6.tar.gz DiligentCore-d8abce94cd08cb73527a9f9e1f12969ba3681ee6.zip | |
Updated GetEngineFactoryVk() and GetEngineFactoryOpenGL() implementations
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
4 files changed, 11 insertions, 21 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt index d32bab6b..913282a8 100644 --- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt +++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt @@ -196,7 +196,7 @@ endif() target_link_libraries(GraphicsEngineOpenGL-static PRIVATE ${PRIVATE_DEPENDENCIES} PUBLIC ${PUBLIC_DEPENDENCIES}) target_link_libraries(GraphicsEngineOpenGL-shared PUBLIC GraphicsEngineOpenGL-static) -target_compile_definitions(GraphicsEngineOpenGL-shared PUBLIC ENGINE_DLL=1 PRIVATE BUILDING_DLL=1) +target_compile_definitions(GraphicsEngineOpenGL-shared PUBLIC ENGINE_DLL=1) if(PLATFORM_WIN32) diff --git a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h index 8d852c9f..b931630e 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h @@ -36,23 +36,17 @@ #include "EngineGLAttribs.h" -#if PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS +#if PLATFORM_WIN32 # define API_QUALIFIER #elif PLATFORM_ANDROID || PLATFORM_LINUX || PLATFORM_MACOS || PLATFORM_IOS -# if ENGINE_DLL -# if BUILDING_DLL - // https://gcc.gnu.org/wiki/Visibility -# define API_QUALIFIER __attribute__((visibility("default"))) -# else -# define API_QUALIFIER __attribute__((visibility("default"))) -# endif -# else -# define API_QUALIFIER -# endif + // https://gcc.gnu.org/wiki/Visibility +# define API_QUALIFIER __attribute__((visibility("default"))) +#else +# error Unsupported platform #endif namespace Diligent @@ -105,7 +99,7 @@ public: return false; } - GetFactoryFunc = reinterpret_cast<GetEngineFactoryOpenGLType>( GetProcAddress(hModule, "GetEngineFactoryOpenGLInternal") ); + GetFactoryFunc = reinterpret_cast<GetEngineFactoryOpenGLType>( GetProcAddress(hModule, "GetEngineFactoryOpenGL") ); if( GetFactoryFunc == NULL ) { std::stringstream ss; @@ -121,11 +115,7 @@ public: // Do not forget to call System.loadLibrary("GraphicsEngineOpenGL") in Java on Android! API_QUALIFIER - inline IEngineFactoryOpenGL* GetEngineFactoryOpenGL() - { - IEngineFactoryOpenGL* GetEngineFactoryOpenGLInternal(); - return GetEngineFactoryOpenGLInternal(); - } + IEngineFactoryOpenGL* GetEngineFactoryOpenGL(); #endif diff --git a/Graphics/GraphicsEngineOpenGL/src/GraphicsEngineOpenGL.def b/Graphics/GraphicsEngineOpenGL/src/GraphicsEngineOpenGL.def index 1de05b4c..2d2ee59f 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GraphicsEngineOpenGL.def +++ b/Graphics/GraphicsEngineOpenGL/src/GraphicsEngineOpenGL.def @@ -1,2 +1,2 @@ EXPORTS - GetEngineFactoryOpenGLInternal
\ No newline at end of file + GetEngineFactoryOpenGL
\ No newline at end of file diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp index 435a655f..cc959951 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp @@ -234,8 +234,8 @@ void EngineFactoryOpenGLImpl::CreateHLSL2GLSLConverter(IHLSL2GLSLConverter **ppC pConverter->QueryInterface( IID_HLSL2GLSLConverter, reinterpret_cast<IObject**>(ppConverter) ); } - -Diligent::IEngineFactoryOpenGL* GetEngineFactoryOpenGLInternal() +API_QUALIFIER +Diligent::IEngineFactoryOpenGL* GetEngineFactoryOpenGL() { return Diligent::EngineFactoryOpenGLImpl::GetInstance(); } |
