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

Method loadLibrary

src/SFML/Window/Unix/VulkanImplX11.cpp:53–85  ·  view source on GitHub ↗

Try to load the library and all the required entry points

Source from the content-addressed store, hash-verified

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

Callers 1

isAvailableMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected