From d8abce94cd08cb73527a9f9e1f12969ba3681ee6 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 3 Nov 2018 10:47:23 -0700 Subject: Updated GetEngineFactoryVk() and GetEngineFactoryOpenGL() implementations --- Graphics/GraphicsEngineOpenGL/CMakeLists.txt | 2 +- .../interface/RenderDeviceFactoryOpenGL.h | 24 +++++++--------------- .../src/GraphicsEngineOpenGL.def | 2 +- .../src/RenderDeviceFactoryOpenGL.cpp | 4 ++-- 4 files changed, 11 insertions(+), 21 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') 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( GetProcAddress(hModule, "GetEngineFactoryOpenGLInternal") ); + GetFactoryFunc = reinterpret_cast( 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(ppConverter) ); } - -Diligent::IEngineFactoryOpenGL* GetEngineFactoryOpenGLInternal() +API_QUALIFIER +Diligent::IEngineFactoryOpenGL* GetEngineFactoryOpenGL() { return Diligent::EngineFactoryOpenGLImpl::GetInstance(); } -- cgit v1.2.3