Path: blob/master/thirdparty/openxr/src/loader/api_layer_interface.hpp
9917 views
// Copyright (c) 2017-2025 The Khronos Group Inc.1// Copyright (c) 2017-2019 Valve Corporation2// Copyright (c) 2017-2019 LunarG, Inc.3//4// SPDX-License-Identifier: Apache-2.0 OR MIT5//6// Initial Author: Mark Young <[email protected]>7//89#pragma once1011#include <string>12#include <vector>13#include <memory>1415#include <openxr/openxr.h>16#include <openxr/openxr_loader_negotiation.h>1718#include "loader_platform.hpp"1920struct XrGeneratedDispatchTable;2122class ApiLayerInterface {23public:24// Factory method25static XrResult LoadApiLayers(const std::string& openxr_command, uint32_t enabled_api_layer_count,26const char* const* enabled_api_layer_names,27std::vector<std::unique_ptr<ApiLayerInterface>>& api_layer_interfaces);28// Static queries29static XrResult GetApiLayerProperties(const std::string& openxr_command, uint32_t incoming_count, uint32_t* outgoing_count,30XrApiLayerProperties* api_layer_properties);31static XrResult GetInstanceExtensionProperties(const std::string& openxr_command, const char* layer_name,32std::vector<XrExtensionProperties>& extension_properties);3334ApiLayerInterface(const std::string& layer_name, LoaderPlatformLibraryHandle layer_library,35std::vector<std::string>& supported_extensions, PFN_xrGetInstanceProcAddr get_instance_proc_addr,36PFN_xrCreateApiLayerInstance create_api_layer_instance);37virtual ~ApiLayerInterface();3839PFN_xrGetInstanceProcAddr GetInstanceProcAddrFuncPointer() { return _get_instance_proc_addr; }40PFN_xrCreateApiLayerInstance GetCreateApiLayerInstanceFuncPointer() { return _create_api_layer_instance; }4142std::string LayerName() { return _layer_name; }4344// Generated methods45bool SupportsExtension(const std::string& extension_name) const;4647private:48std::string _layer_name;49LoaderPlatformLibraryHandle _layer_library;50PFN_xrGetInstanceProcAddr _get_instance_proc_addr;51PFN_xrCreateApiLayerInstance _create_api_layer_instance;52std::vector<std::string> _supported_extensions;53};545556