MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / init

Function init

src/platform/linux/graphics.cpp:270–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268 create_device_fn create_device;
269
270 int init() {
271 static void *handle {nullptr};
272 static bool funcs_loaded = false;
273
274 if (funcs_loaded) {
275 return 0;
276 }
277
278 if (!handle) {
279 handle = dyn::handle({"libgbm.so.1", "libgbm.so"});
280 if (!handle) {
281 return -1;
282 }
283 }
284
285 std::vector<std::tuple<GLADapiproc *, const char *>> funcs {
286 {(GLADapiproc *) &device_destroy, "gbm_device_destroy"},
287 {(GLADapiproc *) &create_device, "gbm_create_device"},
288 };
289
290 if (dyn::load(handle, funcs)) {
291 return -1;
292 }
293
294 funcs_loaded = true;
295 return 0;
296 }
297} // namespace gbm
298
299namespace egl {

Callers

nothing calls this directly

Calls 2

handleFunction · 0.85
loadFunction · 0.85

Tested by

no test coverage detected