Libovr 1.43 Reference Guide

OVR_CAPI_GL.h File Reference

OpenGL-specific structures used by the CAPI interface.

Functions

ovrResult
ovr_CreateTextureSwapChainGL ( ovrSession session, const ovrTextureSwapChainDesc * desc, ovrTextureSwapChain * out_TextureSwapChain )
Creates a TextureSwapChain suitable for use with OpenGL.
ovrResult
ovr_GetTextureSwapChainBufferGL ( ovrSession session, ovrTextureSwapChain chain, int index, unsigned int * out_TexId )
Get a specific buffer within the chain as a GL texture name.
ovrResult
ovr_CreateMirrorTextureWithOptionsGL ( ovrSession session, const ovrMirrorTextureDesc * desc, ovrMirrorTexture * out_MirrorTexture )
Creates a Mirror Texture which is auto-refreshed to mirror Rift contents produced by this application.
ovrResult
ovr_CreateMirrorTextureGL ( ovrSession session, const ovrMirrorTextureDesc * desc, ovrMirrorTexture * out_MirrorTexture )
Deprecated.
ovrResult
ovr_GetMirrorTextureBufferGL ( ovrSession session, ovrMirrorTexture mirrorTexture, unsigned int * out_TexId )
Get a the underlying buffer as a GL texture name.

Detailed Description

Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.

Function Documentation

ovrResult ovr_CreateTextureSwapChainGL ( ovrSession session, const ovrTextureSwapChainDesc * desc, ovrTextureSwapChain * out_TextureSwapChain )
Creates a TextureSwapChain suitable for use with OpenGL.
Parameters
session
Specifies an ovrSession previously returned by ovr_Create.
desc
Specifies the requested texture properties. See notes for more info about texture format.
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
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.
ovrResult ovr_GetTextureSwapChainBufferGL ( ovrSession session, ovrTextureSwapChain chain, int index, unsigned int * out_TexId )
Get a specific buffer within the chain as a GL texture name.
Parameters
session
Specifies an ovrSession previously returned by ovr_Create.
chain
Specifies an ovrTextureSwapChain previously returned by ovr_CreateTextureSwapChainGL
index
Specifies the index within the chain to retrieve. Must be between 0 and length (see ovr_GetTextureSwapChainLength) or may pass -1 to get the buffer at the CurrentIndex location. (Saving a call to GetTextureSwapChainCurrentIndex)
out_TexId
Returns the GL texture object name associated with the specific index requested
Returns an ovrResult indicating success or failure. In the case of failure, use ovr_GetLastErrorInfo to get more information.
ovrResult ovr_CreateMirrorTextureWithOptionsGL ( ovrSession session, const ovrMirrorTextureDesc * desc, ovrMirrorTexture * out_MirrorTexture )
Creates a Mirror Texture which is auto-refreshed to mirror Rift contents produced by this application.
A second call to ovr_CreateMirrorTextureWithOptionsGL for a given ovrSession before destroying the first one is not supported and will result in an error return.
Parameters
session
Specifies an ovrSession previously returned by ovr_Create.
desc
Specifies the requested mirror texture description.
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 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
ovrResult ovr_CreateMirrorTextureGL ( ovrSession session, const ovrMirrorTextureDesc * desc, ovrMirrorTexture * out_MirrorTexture )
Deprecated.
Use ovr_CreateMirrorTextureWithOptionsGL instead
Same as ovr_CreateMirrorTextureWithOptionsGL except doesn't use ovrMirrorOptions flags as part of ovrMirrorTextureDesc's MirrorOptions field, and defaults to ovrMirrorOption_PostDistortion
ovrResult ovr_GetMirrorTextureBufferGL ( ovrSession session, ovrMirrorTexture mirrorTexture, unsigned int * out_TexId )
Get a the underlying buffer as a GL texture name.
Parameters
session
Specifies an ovrSession previously returned by ovr_Create.
mirrorTexture
Specifies an ovrMirrorTexture previously returned
out_TexId
Specifies the GL texture object name associated with the mirror texture
Returns an ovrResult indicating success or failure. In the case of failure, use ovr_GetLastErrorInfo to get more information.
1
7
8
9
10
11
12
13
22
45
46
47
48
49
50
66
67
68
69
70
71
72
91
95
100
101
102
103
104
105
113
114
115
116
117
118
123
129
130
131
132
133
134
135
136
137
/********************************************************************************/
#ifndef OVR_CAPI_GL_h
#define OVR_CAPI_GL_h

#include "OVR_CAPI.h"

#if !defined(OVR_EXPORTING_CAPI)

//              ovr_DestroyTextureSwapChain before destroying the session with ovr_Destroy.
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_CreateTextureSwapChainGL(
    ovrSession session,
const ovrTextureSwapChainDesc* desc,
    ovrTextureSwapChain* out_TextureSwapChain);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetTextureSwapChainBufferGL(
    ovrSession session,
    ovrTextureSwapChain chain,
int index,
unsignedint* out_TexId);

//        are requested as sRGB formats because the distortion compositor does sRGB-correct
//        incorrect gamma conversions leading to gamma-curve artifacts and color banding.
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_CreateMirrorTextureWithOptionsGL(
    ovrSession session,
const ovrMirrorTextureDesc* desc,
    ovrMirrorTexture* out_MirrorTexture);

OVR_PUBLIC_FUNCTION(ovrResult)
ovr_CreateMirrorTextureGL(
    ovrSession session,
const ovrMirrorTextureDesc* desc,
    ovrMirrorTexture* out_MirrorTexture);

//              by ovr_CreateMirrorTextureWithOptionsGL
OVR_PUBLIC_FUNCTION(ovrResult)
ovr_GetMirrorTextureBufferGL(
    ovrSession session,
    ovrMirrorTexture mirrorTexture,
unsignedint* out_TexId);

#endif // !defined(OVR_EXPORTING_CAPI)

#endif // OVR_CAPI_GL_h
The documentation for this file was generated from the following file: Include/OVR_CAPI_GL.h