Struct openxr::Instance [−][src]
pub struct Instance { /* fields omitted */ }
Expand description
Root object mediating an application’s interaction with OpenXR
Constructed from an Entry
.
Implementations
Take ownership of an existing instance handle
Safety
handle
must be the instance handle that was used to load exts
.
Access the internal extension function pointers
Set the debug name of this Instance
, if XR_EXT_debug_utils
is loaded
Construct a Path
from a string
A Path
should only be used with the instance that produced it.
pub unsafe fn create_vulkan_instance(
&self,
system: SystemId,
get_instance_proc_addr: VkGetInstanceProcAddr,
create_info: *const VkInstanceCreateInfo
) -> Result<Result<VkInstance, VkResult>>
pub unsafe fn create_vulkan_instance(
&self,
system: SystemId,
get_instance_proc_addr: VkGetInstanceProcAddr,
create_info: *const VkInstanceCreateInfo
) -> Result<Result<VkInstance, VkResult>>
Create a Vulkan instance suitable for use with a particular system
Instance::graphics_requirements::<Vulkan>()
must be called first.
Safety
pub fn vulkan_graphics_device(
&self,
system: SystemId,
vulkan_instance: VkInstance
) -> Result<VkPhysicalDevice>
pub fn vulkan_graphics_device(
&self,
system: SystemId,
vulkan_instance: VkInstance
) -> Result<VkPhysicalDevice>
Get a suitable VkPhysicalDevice
for use with a particular system
Call Instance::create_vulkan_instance()
first to get a suitable VkInstance
.
Requires KHR_vulkan_enable2.
pub unsafe fn create_vulkan_device(
&self,
system: SystemId,
get_instance_proc_addr: VkGetInstanceProcAddr,
physical_device: VkPhysicalDevice,
create_info: *const VkDeviceCreateInfo
) -> Result<Result<VkDevice, VkResult>>
pub unsafe fn create_vulkan_device(
&self,
system: SystemId,
get_instance_proc_addr: VkGetInstanceProcAddr,
physical_device: VkPhysicalDevice,
create_info: *const VkDeviceCreateInfo
) -> Result<Result<VkDevice, VkResult>>
Get a suitable VkDevice
for use with a particular system
Call Instance::vulkan_graphics_device()
first to get a suitable VkPhysicalDevice
.
Safety
Query graphics API version requirements
pub unsafe fn create_session<G: Graphics>(
&self,
system: SystemId,
info: &G::SessionCreateInfo
) -> Result<(Session<G>, FrameWaiter, FrameStream<G>)>
pub unsafe fn create_session<G: Graphics>(
&self,
system: SystemId,
info: &G::SessionCreateInfo
) -> Result<(Session<G>, FrameWaiter, FrameStream<G>)>
Create a session for a particular graphics API
Returns three separate objects:
Session
exposes most session-related operations and is cheap to cloneFrameWaiter
allows blocking until it is time to begin graphics device work, and cannot be clonedFrameStream
allows callers to mark the beginning of graphics device work and submit completed frames for presentation
These objects are separate to ensure multithreaded pipelined renderers can safely wait for the cue to begin a new frame while a prior frame is still being rendered without additional synchronization.
Safety
The requirements documented by the graphics API extension must be respected. Among other
requirements, info
must contain valid handles, and certain operations must be externally
synchronized.
Get the next event, if available
Returns immediately regardless of whether an event was available.
pub fn enumerate_view_configurations(
&self,
system: SystemId
) -> Result<Vec<ViewConfigurationType>>
pub fn enumerate_view_configurations(
&self,
system: SystemId
) -> Result<Vec<ViewConfigurationType>>
Enumerates the supported view configuration types
pub fn view_configuration_properties(
&self,
system: SystemId,
ty: ViewConfigurationType
) -> Result<ViewConfigurationProperties>
pub fn view_configuration_properties(
&self,
system: SystemId,
ty: ViewConfigurationType
) -> Result<ViewConfigurationProperties>
Query properties of an individual view configuration
pub fn enumerate_view_configuration_views(
&self,
system: SystemId,
ty: ViewConfigurationType
) -> Result<Vec<ViewConfigurationView>>
pub fn enumerate_environment_blend_modes(
&self,
system: SystemId,
view_configuration_type: ViewConfigurationType
) -> Result<Vec<EnvironmentBlendMode>>
Obtain the current Time
Requires KHR_convert_timespec_time. Most applications should use times from
FrameStream::wait
and Action::state
instead.
Specify default bindings for a well-known input archetype
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Instance
impl UnwindSafe for Instance
Blanket Implementations
Mutably borrows from an owned value. Read more