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/GraphicsEngineVulkan/CMakeLists.txt | 2 +- .../interface/RenderDeviceFactoryVk.h | 20 ++++---------------- .../GraphicsEngineVulkan/src/GraphicsEngineVk.def | 2 +- .../src/RenderDeviceFactoryVk.cpp | 4 ++-- 4 files changed, 8 insertions(+), 20 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt index b4ed89c4..09148e3e 100644 --- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt +++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt @@ -190,7 +190,7 @@ set(PUBLIC_DEPENDENCIES target_link_libraries(GraphicsEngineVk-static PRIVATE ${PRIVATE_DEPENDENCIES} PUBLIC ${PUBLIC_DEPENDENCIES}) target_link_libraries(GraphicsEngineVk-shared PUBLIC GraphicsEngineVk-static) -target_compile_definitions(GraphicsEngineVk-shared PUBLIC ENGINE_DLL=1 PRIVATE BUILDING_DLL=1) +target_compile_definitions(GraphicsEngineVk-shared PUBLIC ENGINE_DLL=1) if(PLATFORM_WIN32) diff --git a/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h b/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h index a6d9afb4..8e42c674 100644 --- a/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h @@ -38,16 +38,8 @@ #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 @@ -111,7 +103,7 @@ namespace Diligent return false; } - GetFactoryFunc = reinterpret_cast(GetProcAddress(hModule, "GetEngineFactoryVkInternal")); + GetFactoryFunc = reinterpret_cast(GetProcAddress(hModule, "GetEngineFactoryVk")); if (GetFactoryFunc == NULL) { std::stringstream ss; @@ -126,11 +118,7 @@ namespace Diligent #else API_QUALIFIER - inline IEngineFactoryVk* GetEngineFactoryVk() - { - IEngineFactoryVk* GetEngineFactoryVkInternal(); - return GetEngineFactoryVkInternal(); - } + IEngineFactoryVk* GetEngineFactoryVk(); #endif diff --git a/Graphics/GraphicsEngineVulkan/src/GraphicsEngineVk.def b/Graphics/GraphicsEngineVulkan/src/GraphicsEngineVk.def index c2834d59..a9ed58f5 100644 --- a/Graphics/GraphicsEngineVulkan/src/GraphicsEngineVk.def +++ b/Graphics/GraphicsEngineVulkan/src/GraphicsEngineVk.def @@ -1,2 +1,2 @@ EXPORTS - GetEngineFactoryVkInternal \ No newline at end of file + GetEngineFactoryVk \ No newline at end of file diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp index ef78f426..6e572638 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp @@ -374,8 +374,8 @@ void LoadGraphicsEngineVk(GetEngineFactoryVkType &GetFactoryFunc) } #endif - -IEngineFactoryVk* GetEngineFactoryVkInternal() +API_QUALIFIER +IEngineFactoryVk* GetEngineFactoryVk() { return EngineFactoryVkImpl::GetInstance(); } -- cgit v1.2.3