aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mac_vulkan.m6
-rw-r--r--src/win_vulkan.c8
-rw-r--r--src/x11_vulkan.c6
3 files changed, 13 insertions, 7 deletions
diff --git a/src/mac_vulkan.m b/src/mac_vulkan.m
index 2362db1..45c4839 100644
--- a/src/mac_vulkan.m
+++ b/src/mac_vulkan.m
@@ -107,7 +107,8 @@ struct PuglVulkanLoaderImpl {
};
PuglVulkanLoader*
-puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world))
+puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world),
+ const char* const libraryName)
{
PuglVulkanLoader* loader =
(PuglVulkanLoader*)calloc(1, sizeof(PuglVulkanLoader));
@@ -115,7 +116,8 @@ puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world))
return NULL;
}
- if (!(loader->libvulkan = dlopen("libvulkan.dylib", RTLD_LAZY))) {
+ const char* const filename = libraryName ? libraryName : "libvulkan.dylib";
+ if (!(loader->libvulkan = dlopen(filename, RTLD_LAZY))) {
free(loader);
return NULL;
}
diff --git a/src/win_vulkan.c b/src/win_vulkan.c
index ddd3fbe..4a4d005 100644
--- a/src/win_vulkan.c
+++ b/src/win_vulkan.c
@@ -21,7 +21,8 @@ struct PuglVulkanLoaderImpl {
};
PuglVulkanLoader*
-puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world))
+puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world),
+ const char* const libraryName)
{
PuglVulkanLoader* loader =
(PuglVulkanLoader*)calloc(1, sizeof(PuglVulkanLoader));
@@ -29,8 +30,9 @@ puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world))
return NULL;
}
- const DWORD flags = LOAD_LIBRARY_SEARCH_DEFAULT_DIRS;
- if (!(loader->libvulkan = LoadLibraryEx("vulkan-1.dll", NULL, flags))) {
+ const DWORD flags = LOAD_LIBRARY_SEARCH_DEFAULT_DIRS;
+ const char* const filename = libraryName ? libraryName : "vulkan-1.dll";
+ if (!(loader->libvulkan = LoadLibraryEx(filename, NULL, flags))) {
free(loader);
return NULL;
}
diff --git a/src/x11_vulkan.c b/src/x11_vulkan.c
index 54b1218..834ac37 100644
--- a/src/x11_vulkan.c
+++ b/src/x11_vulkan.c
@@ -26,9 +26,11 @@ struct PuglVulkanLoaderImpl {
};
PuglVulkanLoader*
-puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world))
+puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world),
+ const char* const libraryName)
{
- void* const libvulkan = dlopen("libvulkan.so", RTLD_LAZY);
+ const char* const filename = libraryName ? libraryName : "libvulkan.so";
+ void* const libvulkan = dlopen(filename, RTLD_LAZY);
if (!libvulkan) {
return NULL;
}