Auto-Vk-Toolkit icon indicating copy to clipboard operation
Auto-Vk-Toolkit copied to clipboard

Design of `avk::context()` actually prevents building as shared library

Open libreliu opened this issue 1 year ago • 1 comments

Hi,

Thanks for the library!

But the code inside auto_vk_toolkit.hpp will actually be troublesome if Auto-Vk-Toolkit is linked dynamically, since multiple context_vulkan instances will exists in different part of the code (one in so/dll, another in the main program because it's inlined).

// include/auto_vk_toolkit.hpp#L201
	inline auto& context()
	{
		static context_vulkan sContext;
		return sContext;
	}

libreliu avatar May 25 '23 16:05 libreliu

I agree that it would be cool to have the possibility to build as dynamic library. Unfortunately, I am currently unable to work on a refactoring like this, but pull requests are always welcome.

johannesugb avatar Dec 09 '23 07:12 johannesugb