pub struct Entry { /* private fields */ }
Expand description
Entry point to the API. Start here.
An Entry
represents access to an OpenXR implementation. When the crate is built with the
linked
feature, this can be obtained at compile time with the linked
constructor. The
static
feature provides a built-in copy of the Khronos OpenXR loader for use in this
pattern. Alternatively, the loaded
feature exposes the load
and load_from
constructors to
manually load an OpenXR implementation at run-time.
Implementations§
source§impl Entry
impl Entry
sourcepub fn linked() -> Self
pub fn linked() -> Self
Access entry points linked directly into the binary at compile time
Available if the linked
feature is enabled. You must ensure that the entry points are
actually linked into the binary, e.g. by enabling the static
feature or manually linking
to an external loader or implementation.
sourcepub unsafe fn load() -> Result<Self, LoadError>
pub unsafe fn load() -> Result<Self, LoadError>
Load entry points at run time from the dynamic library openxr_loader
according to the
target platform’s naming conventions
Available if the loaded
feature is enabled.
§Safety
The OpenXR loader shared library in the dynamic loader’s search path must conform to the OpenXR specification.
sourcepub unsafe fn load_from(path: &Path) -> Result<Self, LoadError>
pub unsafe fn load_from(path: &Path) -> Result<Self, LoadError>
Load entry points at run time from the dynamic library identified by path
Available if the loaded
feature is enabled.
§Safety
path
must be a shared library that provides OpenXR-compliant definitions for every core
OpenXR entry point.
sourcepub unsafe fn from_get_instance_proc_addr(
get_instance_proc_addr: GetInstanceProcAddr,
) -> Result<Self>
pub unsafe fn from_get_instance_proc_addr( get_instance_proc_addr: GetInstanceProcAddr, ) -> Result<Self>
Load entry points using an arbitrary xrGetInstanceProcAddr
implementation
§Safety
For all core OpenXR instance functions, get_instance_proc_addr
must yield function
pointers that satisfy the semantics given in the OpenXR specification.
sourcepub fn create_instance(
&self,
app_info: &ApplicationInfo<'_>,
required_extensions: &ExtensionSet,
layers: &[&str],
) -> Result<Instance>
pub fn create_instance( &self, app_info: &ApplicationInfo<'_>, required_extensions: &ExtensionSet, layers: &[&str], ) -> Result<Instance>
Create an OpenXR instance with certain extensions enabled. Android support can be enabled by
setting khr_android_create_instance
to true
.
Most applications will want to enable at least one graphics API extension
(e.g. khr_vulkan_enable2
) so that a Session
can be created for rendering.
sourcepub fn enumerate_extensions(&self) -> Result<ExtensionSet>
pub fn enumerate_extensions(&self) -> Result<ExtensionSet>
Determine the set of extensions supported by this OpenXR implementation
pub fn enumerate_layers(&self) -> Result<Vec<ApiLayerProperties>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnwindSafe for Entry
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)