xr.api_layer package

Subpackages

Submodules

xr.api_layer.dynamic_api_layer_base module

class xr.api_layer.dynamic_api_layer_base.DynamicApiLayerBase(name: str, description: str = '', json_path=None)

Bases: ABC

Base class for temporary dynamic runtime python OpenXR API layers.

property name: str
abstract negotiate_loader_api_layer_interface(loader_info: NegotiateLoaderInfo, layer_name: str, api_layer_request: NegotiateApiLayerRequest) Result

Override this method in a derived class to create your own temporary dynamic OpenXR API layer.

If this layer is able to support the request, it must: return xr.Result.SUCCESS and:

Fill in pname:layerRequest→pname:layerInterfaceVersion with the API layer interface version it desires to support. Fill in pname:layerRequest→pname:layerApiVersion with the API version of OpenXR it will execute under. Fill in pname:layerRequest→pname:getInstanceProcAddr with a valid function pointer so that the loader can query function pointers to the remaining OpenXR commands supported by the API layer. Fill in pname:layerRequest→pname:createLayerInstance with a valid function pointer so that the loader can create the instance through the API layer call chain.

Otherwise, it must: return XR_ERROR_INITIALIZATION_FAILED

Param:

loader_info: must be a valid pointer to a constant xr.NegotiateLoaderInfo structure.

Param:

layer_name: must be a string listing the name of an API layer which the loader is attempting to negotiate with.

Param:

api_layer_request: must be a valid pointer to a xr.NegotiateApiLayerRequest structure.

Returns:

xr.Result.SUCCESS or xr.Result.ERROR_INITIALIZATION_FAILED

xr.api_layer.layer_path module

xr.api_layer.layer_path.add_folder_to_api_layer_path(folder_name: str)
xr.api_layer.layer_path.expose_packaged_api_layers()

Make pre-packaged layers available to the openxr loader

xr.api_layer.layer_path.py_layer_library_path() str

Path to a shared library file used for dynamic API layer dispatch.

xr.api_layer.loader_interfaces module

class xr.api_layer.loader_interfaces.ApiLayerCreateInfo

Bases: Structure

loader_instance

Structure/Union member

next_info

Structure/Union member

settings_file_location

Structure/Union member

struct_size

Structure/Union member

struct_type

Structure/Union member

struct_version

Structure/Union member

class xr.api_layer.loader_interfaces.NegotiateApiLayerRequest

Bases: Structure

create_api_layer_instance

Structure/Union member

get_instance_proc_addr

Structure/Union member

layer_api_version

Structure/Union member

layer_interface_version

Structure/Union member

struct_size

Structure/Union member

struct_type

Structure/Union member

struct_version

Structure/Union member

class xr.api_layer.loader_interfaces.NegotiateLoaderInfo

Bases: Structure

max_api_version

Structure/Union member

max_interface_version

Structure/Union member

min_api_version

Structure/Union member

min_interface_version

Structure/Union member

struct_size

Structure/Union member

struct_type

Structure/Union member

struct_version

Structure/Union member

xr.api_layer.loader_interfaces.PFN_xrCreateApiLayerInstance

alias of CFunctionType

xr.api_layer.loader_interfaces.PFN_xrNegotiateLoaderApiLayerInterface

alias of CFunctionType

xr.api_layer.raw_functions module

xr.api_layer.steamvr_linux_destroyinstance_layer module

class xr.api_layer.steamvr_linux_destroyinstance_layer.SteamVrLinuxDestroyInstanceLayer

Bases: DynamicApiLayerBase

Pure-python OpenXR API layer. Designed to work around SteamVR linux bug. https://steamcommunity.com/app/250820/discussions/8/3114772813482874960/ https://github.com/cmbruns/pyopenxr/pull/66

create_api_layer_instance(info: LP_InstanceCreateInfo, api_layer_info: LP_ApiLayerCreateInfo, instance: Instance) Result
destroy_instance(instance: Instance) Result
get_instance_proc_addr(instance: Instance, name: c_char_p, function: LP_CFunctionType) Result
negotiate_loader_api_layer_interface(loader_info: NegotiateLoaderInfo, layer_name: str, api_layer_request: NegotiateApiLayerRequest) Result

Set up our layer to intercept OpenXR function calls. :param loader_info: :param layer_name: The name of an API layer which the loader is attempting to negotiate with. :param api_layer_request: Fill in this information. :return: xr.Result.SUCCESS or xr.Result.ERROR_INITIALIZATION_FAILED

Module contents

class xr.api_layer.ApiLayerCreateInfo

Bases: Structure

loader_instance

Structure/Union member

next_info

Structure/Union member

settings_file_location

Structure/Union member

struct_size

Structure/Union member

struct_type

Structure/Union member

struct_version

Structure/Union member

class xr.api_layer.DynamicApiLayerBase(name: str, description: str = '', json_path=None)

Bases: ABC

Base class for temporary dynamic runtime python OpenXR API layers.

property name: str
abstract negotiate_loader_api_layer_interface(loader_info: NegotiateLoaderInfo, layer_name: str, api_layer_request: NegotiateApiLayerRequest) Result

Override this method in a derived class to create your own temporary dynamic OpenXR API layer.

If this layer is able to support the request, it must: return xr.Result.SUCCESS and:

Fill in pname:layerRequest→pname:layerInterfaceVersion with the API layer interface version it desires to support. Fill in pname:layerRequest→pname:layerApiVersion with the API version of OpenXR it will execute under. Fill in pname:layerRequest→pname:getInstanceProcAddr with a valid function pointer so that the loader can query function pointers to the remaining OpenXR commands supported by the API layer. Fill in pname:layerRequest→pname:createLayerInstance with a valid function pointer so that the loader can create the instance through the API layer call chain.

Otherwise, it must: return XR_ERROR_INITIALIZATION_FAILED

Param:

loader_info: must be a valid pointer to a constant xr.NegotiateLoaderInfo structure.

Param:

layer_name: must be a string listing the name of an API layer which the loader is attempting to negotiate with.

Param:

api_layer_request: must be a valid pointer to a xr.NegotiateApiLayerRequest structure.

Returns:

xr.Result.SUCCESS or xr.Result.ERROR_INITIALIZATION_FAILED

class xr.api_layer.NegotiateApiLayerRequest

Bases: Structure

create_api_layer_instance

Structure/Union member

get_instance_proc_addr

Structure/Union member

layer_api_version

Structure/Union member

layer_interface_version

Structure/Union member

struct_size

Structure/Union member

struct_type

Structure/Union member

struct_version

Structure/Union member

class xr.api_layer.NegotiateLoaderInfo

Bases: Structure

max_api_version

Structure/Union member

max_interface_version

Structure/Union member

min_api_version

Structure/Union member

min_interface_version

Structure/Union member

struct_size

Structure/Union member

struct_type

Structure/Union member

struct_version

Structure/Union member

xr.api_layer.PFN_xrCreateApiLayerInstance

alias of CFunctionType

xr.api_layer.PFN_xrNegotiateLoaderApiLayerInterface

alias of CFunctionType

xr.api_layer.expose_packaged_api_layers()

Make pre-packaged layers available to the openxr loader