Function ovr_sys::opengl::ovr_CreateMirrorTextureGL
source · pub unsafe extern "C" fn ovr_CreateMirrorTextureGL(
session: ovrSession,
desc: *const ovrMirrorTextureDesc,
out_MirrorTexture: *mut ovrMirrorTexture
) -> ovrResult
Expand description
Creates a Mirror Texture which is auto-refreshed to mirror Rift contents produced by this application.
A second call to ovr_CreateMirrorTextureGL
for a given ovrSession
before destroying the first one
is not supported and will result in an error return.
in session
Specifies an ovrSession
previously returned by ovr_Create
.
in desc
Specifies the requested mirror texture description.
out out_MirrorTexture
Specifies the created ovrMirrorTexture
, which will be valid upon a successful return value, else it will be NULL.
This texture must be eventually destroyed via ovr_DestroyMirrorTexture
before destroying the session with ovr_Destroy
.
Returns an ovrResult
indicating success or failure. In the case of failure, use
ovr_GetLastErrorInfo
to get more information.
Note: The format provided should be thought of as the format the distortion compositor will use when writing into the mirror
texture. It is highly recommended that mirror textures are requested as sRGB formats because the distortion compositor
does sRGB-correct rendering. If the application requests a non-sRGB format (e.g. R8G8B8A8_UNORM
) as the mirror texture,
then the application might have to apply a manual linear-to-gamma conversion when reading from the mirror texture.
Failure to do so can result in incorrect gamma conversions leading to gamma-curve artifacts and color banding.
see ovr_GetMirrorTextureBufferGL
, ovr_DestroyMirrorTexture