Function ovr_sys::opengl::ovr_CreateTextureSwapChainGL
source · pub unsafe extern "C" fn ovr_CreateTextureSwapChainGL(
session: ovrSession,
desc: *const ovrTextureSwapChainDesc,
out_TextureSwapChain: *mut ovrTextureSwapChain
) -> ovrResult
Expand description
Creates a TextureSwapChain suitable for use with OpenGL.
in session
Specifies an ovrSession
previously returned by ovr_Create
.
in desc
Specifies the requested texture properties. See notes for more info about texture format.
out out_TextureSwapChain
Returns the created ovrTextureSwapChain
, which will be valid upon
a successful return value, else it will be NULL. This texture swap chain must be eventually
destroyed via ovr_DestroyTextureSwapChain
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 reading
the contents of the texture. To that end, it is highly recommended that the application requests texture swap chain
formats that are in sRGB-space (e.g. OVR_FORMAT_R8G8B8A8_UNORM_SRGB
) as the distortion compositor does sRGB-correct
rendering. Furthermore, the app should then make sure glEnable(GL_FRAMEBUFFER_SRGB);
is called before rendering
into these textures. Even though it is not recommended, if the application would like to treat the texture as a linear
format and do linear-to-gamma conversion in GLSL, then the application can avoid calling glEnable(GL_FRAMEBUFFER_SRGB);
,
but should still pass in an sRGB variant for the format. Failure to do so will cause the distortion compositor
to apply incorrect gamma conversions leading to gamma-curve artifacts.
see ovr_GetTextureSwapChainLength
, ovr_GetTextureSwapChainCurrentIndex
, ovr_GetTextureSwapChainDesc
, ovr_GetTextureSwapChainBufferGL
, ovr_DestroyTextureSwapChain