Skip to content

Commit

Permalink
vk: added vulkan unload function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed May 7, 2018
1 parent fbfd69f commit fd0029c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions example/c/vulkan_tri_glfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2213,6 +2213,8 @@ static void demo_cleanup(struct demo *demo) {

free(demo->queue_props);

gladUnloadVulkanInternalLoader();

glfwDestroyWindow(demo->window);
glfwTerminate();
}
Expand Down
8 changes: 8 additions & 0 deletions glad/generator/c/templates/loader/vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,12 @@ int gladLoadVulkanInternalLoader({{ template_utils.context_arg(',') }} VkInstanc
return version;
}


void gladUnloadVulkanInternalLoader() {
if (_vulkan_handle != NULL) {
glad_close_dlopen_handle(_vulkan_handle);
_vulkan_handle = NULL;
}
}

#endif /* GLAD_VULKAN */
1 change: 1 addition & 0 deletions glad/generator/c/templates/loader/vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
#ifdef GLAD_VULKAN

VKAPI_CALL int gladLoadVulkanInternalLoader({{ template_utils.context_arg(',') }} VkInstance instance, VkDevice device);
VKAPI_CALL void gladUnloadVulkanInternalLoader();

#endif

0 comments on commit fd0029c

Please sign in to comment.