#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "loader_instance.hpp"
#include "api_layer_interface.hpp"
#include "hex_and_handles.h"
#include "loader_logger.hpp"
#include "runtime_interface.hpp"
#include "xr_generated_dispatch_table_core.h"
#include "xr_generated_loader.hpp"
#include <openxr/openxr.h>
#include <openxr/openxr_loader_negotiation.h>
#include <cstring>
#include <memory>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
namespace {
std::unique_ptr<LoaderInstance>& GetSetCurrentLoaderInstance() { … }
}
namespace ActiveLoaderInstance {
XrResult Set(std::unique_ptr<LoaderInstance> loader_instance, const char* log_function_name) { … }
XrResult Get(LoaderInstance** loader_instance, const char* log_function_name) { … }
bool IsAvailable() { … }
void Remove() { … }
}
const std::array<XrExtensionProperties, 1>& LoaderInstance::LoaderSpecificExtensions() { … }
namespace {
class InstanceCreateInfoManager { … };
}
XrResult LoaderInstance::CreateInstance(PFN_xrGetInstanceProcAddr get_instance_proc_addr_term,
PFN_xrCreateInstance create_instance_term,
PFN_xrCreateApiLayerInstance create_api_layer_instance_term,
std::vector<std::unique_ptr<ApiLayerInterface>> api_layer_interfaces,
const XrInstanceCreateInfo* info, std::unique_ptr<LoaderInstance>* loader_instance) { … }
XrResult LoaderInstance::GetInstanceProcAddr(const char* name, PFN_xrVoidFunction* function) { … }
LoaderInstance::LoaderInstance(XrInstance instance, const XrInstanceCreateInfo* create_info, PFN_xrGetInstanceProcAddr topmost_gipa,
std::vector<std::unique_ptr<ApiLayerInterface>> api_layer_interfaces)
: … { … }
LoaderInstance::~LoaderInstance() { … }
bool LoaderInstance::ExtensionIsEnabled(const std::string& extension) { … }