// Copyright (c) 2017-2024, The Khronos Group Inc. // Copyright (c) 2017-2019 Valve Corporation // Copyright (c) 2017-2019 LunarG, Inc. // // SPDX-License-Identifier: Apache-2.0 OR MIT // // Initial Author: Mark Young <[email protected]> // #pragma once #include "extra_algorithms.h" #include <openxr/openxr.h> #include <openxr/openxr_loader_negotiation.h> #include <array> #include <cmath> #include <memory> #include <mutex> #include <string> #include <unordered_map> #include <vector> class ApiLayerInterface; struct XrGeneratedDispatchTableCore; class LoaderInstance; // Manage the single loader instance that is available. namespace ActiveLoaderInstance { // Set the active loader instance. This will fail if there is already an active loader instance. XrResult Set(std::unique_ptr<LoaderInstance> loader_instance, const char* log_function_name); // Returns true if there is an active loader instance. bool IsAvailable(); // Get the active LoaderInstance. XrResult Get(LoaderInstance** loader_instance, const char* log_function_name); // Destroy the currently active LoaderInstance if there is one. This will make the loader able to create a new XrInstance if needed. void Remove(); }; // namespace ActiveLoaderInstance // Manages information needed by the loader for an XrInstance, such as what extensions are available and the dispatch table. class LoaderInstance { … };