aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/cpp/include/pugl/vulkan.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-01-14 15:21:36 -0500
committerDavid Robillard <d@drobilla.net>2023-01-14 16:18:27 -0500
commit64131038a4f0c3e3f5f5b95e083f0320a68de058 (patch)
tree1a94a4e1811495d746a16c038be0d1e0e345f622 /bindings/cpp/include/pugl/vulkan.hpp
parente8dc1d219f4b461f29e11ad8fe0e463c6dfdb08b (diff)
downloadpugl-64131038a4f0c3e3f5f5b95e083f0320a68de058.tar.gz
pugl-64131038a4f0c3e3f5f5b95e083f0320a68de058.tar.bz2
pugl-64131038a4f0c3e3f5f5b95e083f0320a68de058.zip
Allow applications to specify the Vulkan library path
I don't know if vendoring the Vulkan library is appropriate, but regardless, this allows applications to set the name to whatever they want, or specify an absolute path, just in case the standard value baked into Pugl isn't the right one in some situation.
Diffstat (limited to 'bindings/cpp/include/pugl/vulkan.hpp')
-rw-r--r--bindings/cpp/include/pugl/vulkan.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/bindings/cpp/include/pugl/vulkan.hpp b/bindings/cpp/include/pugl/vulkan.hpp
index a742085..5bb790d 100644
--- a/bindings/cpp/include/pugl/vulkan.hpp
+++ b/bindings/cpp/include/pugl/vulkan.hpp
@@ -51,7 +51,20 @@ public:
failed loader, but the accessors will always return null.
*/
explicit VulkanLoader(World& world) noexcept
- : Wrapper{puglNewVulkanLoader(world.cobj())}
+ : VulkanLoader{world, nullptr}
+ {}
+
+ /**
+ Create a new dynamic loader for Vulkan functions from a specific library.
+
+ This is the same as the simpler constructor, but allows the user to
+ specify the name of the Vulkan library to load, for certain packaging
+ scenarios or unusual/unsupported system configurations. The `libraryName`
+ is passed to the system library loading function (`dlopen` or
+ `LoadLibrary`), and supports an absolute path.
+ */
+ explicit VulkanLoader(World& world, const char* const libraryName) noexcept
+ : Wrapper{puglNewVulkanLoader(world.cobj(), libraryName)}
{}
/**