MCPcopy Create free account
hub / github.com/SFML/SFML / loadLibrary

Method loadLibrary

src/SFML/Window/Win32/VulkanImplWin32.cpp:52–84  ·  view source on GitHub ↗

Try to load the library and all the required entry points

Source from the content-addressed store, hash-verified

50
51 // Try to load the library and all the required entry points
52 bool loadLibrary()
53 {
54 if (library)
55 return true;
56
57 library = LoadLibraryA("vulkan-1.dll");
58
59 if (!library)
60 return false;
61
62 if (!loadEntryPoint(vkGetInstanceProcAddr, "vkGetInstanceProcAddr"))
63 {
64 FreeLibrary(library);
65 library = nullptr;
66 return false;
67 }
68
69 if (!loadEntryPoint(vkEnumerateInstanceLayerProperties, "vkEnumerateInstanceLayerProperties"))
70 {
71 FreeLibrary(library);
72 library = nullptr;
73 return false;
74 }
75
76 if (!loadEntryPoint(vkEnumerateInstanceExtensionProperties, "vkEnumerateInstanceExtensionProperties"))
77 {
78 FreeLibrary(library);
79 library = nullptr;
80 return false;
81 }
82
83 return true;
84 }
85
86 template <typename T>
87 bool loadEntryPoint(T& entryPoint, const char* name)

Callers 1

isAvailableMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected