Skip to content

Instantly share code, notes, and snippets.

@ratchetfreak
Created February 18, 2016 14:19
Show Gist options
  • Save ratchetfreak/f30fc2362b2d7c362738 to your computer and use it in GitHub Desktop.
Save ratchetfreak/f30fc2362b2d7c362738 to your computer and use it in GitHub Desktop.
HMODULE vulkanLib = LoadLibrary("vulkan-1.dll");
if(vulkanLib == null) //no vulkan installed error out
exit(1);
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) GetProcAddress(vulkanLib, "vkGetInstanceProcAddr");
PFN_vkCreateInstance vkCreateInstance = (FPN_vkCreateInstance) vkGetInstanceProcAddr(null, "vkCreateInstance");
VkInstance instance;
VkResult result = vkCreateInstance(..., null, &instance);
if( result!= VK_SUCCESS) //no vulkan installed error out
exit(1);
//load the remaining function pointers using vkGetInstanceProcAddr(instace, "...");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment