aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-21 17:48:19 +0100
committerDavid Robillard <d@drobilla.net>2020-11-25 14:18:04 +0100
commit3e9a2e01da169007b6fc16492f812055645f6d5f (patch)
treee761ca334ee9b0e3bd91b3a6f83ab1373dd7aa7f /examples
parent6426b03476fb91efbd90acd599472010f5474390 (diff)
downloadpugl-3e9a2e01da169007b6fc16492f812055645f6d5f.tar.gz
pugl-3e9a2e01da169007b6fc16492f812055645f6d5f.tar.bz2
pugl-3e9a2e01da169007b6fc16492f812055645f6d5f.zip
Pass vkGetInstanceProcAddr to puglCreateSurface instead of a loader
This allows puglCreateSurface() to be used with some other loader, or when linking to Vulkan at compile time.
Diffstat (limited to 'examples')
-rw-r--r--examples/pugl_vulkan_cxx_demo.cpp7
-rw-r--r--examples/pugl_vulkan_demo.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/examples/pugl_vulkan_cxx_demo.cpp b/examples/pugl_vulkan_cxx_demo.cpp
index 7a4e5cb..6da5e5a 100644
--- a/examples/pugl_vulkan_cxx_demo.cpp
+++ b/examples/pugl_vulkan_cxx_demo.cpp
@@ -417,8 +417,11 @@ GraphicsDevice::init(const pugl::VulkanLoader& loader,
// Create a Vulkan surface for the window using the Pugl API
VkSurfaceKHR surfaceHandle = {};
- if ((r = pugl::createSurface(
- loader, view, context.instance, nullptr, &surfaceHandle))) {
+ if ((r = pugl::createSurface(loader.getInstanceProcAddrFunc(),
+ view,
+ context.instance,
+ nullptr,
+ &surfaceHandle))) {
return r;
}
diff --git a/examples/pugl_vulkan_demo.c b/examples/pugl_vulkan_demo.c
index a65731b..3f684fe 100644
--- a/examples/pugl_vulkan_demo.c
+++ b/examples/pugl_vulkan_demo.c
@@ -1100,8 +1100,11 @@ main(int argc, char** argv)
// Create Vulkan surface for Window
PuglVulkanLoader* loader = puglNewVulkanLoader(app.world);
- if (puglCreateSurface(
- loader, app.view, vk->instance, ALLOC_VK, &vk->surface)) {
+ if (puglCreateSurface(puglGetInstanceProcAddrFunc(loader),
+ app.view,
+ vk->instance,
+ ALLOC_VK,
+ &vk->surface)) {
return logError("Failed to create surface\n");
}