Function ovr_sys::ovr_Create
source · pub unsafe extern "C" fn ovr_Create(
pSession: *mut ovrSession,
pLuid: *mut ovrGraphicsLuid
) -> ovrResult
Expand description
Creates a handle to a VR session.
Upon success the returned ovrSession
must be eventually freed with ovr_Destroy
when it is no longer needed.
A second call to ovr_Create
will result in an error return value if the previous session has not been destroyed.
out pSession
Provides a pointer to an ovrSession
which will be written to upon success.
out luid
Provides a system specific graphics adapter identifier that locates which
graphics adapter has the HMD attached. This must match the adapter used by the application
or no rendering output will be possible. This is important for stability on multi-adapter systems. An
application that simply chooses the default adapter will not run reliably on multi-adapter systems.
Returns an ovrResult
indicating success or failure. Upon failure
the returned ovrSession
will be NULL.
Example code
let mut session: ovrSession = mem::uninitialized();
let mut luid: ovrGraphicsLuid = mem::uninitialized();
let result = ovr_Create(&mut session as *mut _, &mut luid as *mut _);
if OVR_FAILURE(result) {
// handle error
}
see ovr_Destroy