Class OVRGL
- java.lang.Object
-
- org.lwjgl.ovr.OVRGL
-
public class OVRGL extends java.lang.Object
Native bindings to libOVR, using the Oculus SDK C API.This class contains OpenGL specific functionality.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
novr_CreateMirrorTextureGL(long session, long desc, long out_MirrorTexture)
Unsafe version of:CreateMirrorTextureGL
static int
novr_CreateMirrorTextureWithOptionsGL(long session, long desc, long out_MirrorTexture)
Unsafe version of:CreateMirrorTextureWithOptionsGL
static int
novr_CreateTextureSwapChainGL(long session, long desc, long out_TextureSwapChain)
Unsafe version of:CreateTextureSwapChainGL
static int
novr_GetMirrorTextureBufferGL(long session, long mirrorTexture, int[] out_TexId)
Array version of:novr_GetMirrorTextureBufferGL(long, long, long)
static int
novr_GetMirrorTextureBufferGL(long session, long mirrorTexture, long out_TexId)
Unsafe version of:GetMirrorTextureBufferGL
static int
novr_GetTextureSwapChainBufferGL(long session, long chain, int index, int[] out_TexId)
Array version of:novr_GetTextureSwapChainBufferGL(long, long, int, long)
static int
novr_GetTextureSwapChainBufferGL(long session, long chain, int index, long out_TexId)
Unsafe version of:GetTextureSwapChainBufferGL
static int
ovr_CreateMirrorTextureGL(long session, OVRMirrorTextureDesc desc, org.lwjgl.PointerBuffer out_MirrorTexture)
Deprecated.static int
ovr_CreateMirrorTextureWithOptionsGL(long session, OVRMirrorTextureDesc desc, org.lwjgl.PointerBuffer out_MirrorTexture)
Creates a Mirror Texture which is auto-refreshed to mirror Rift contents produced by this application.static int
ovr_CreateTextureSwapChainGL(long session, OVRTextureSwapChainDesc desc, org.lwjgl.PointerBuffer out_TextureSwapChain)
Creates a TextureSwapChain suitable for use with OpenGL.static int
ovr_GetMirrorTextureBufferGL(long session, long mirrorTexture, int[] out_TexId)
Array version of:GetMirrorTextureBufferGL
static int
ovr_GetMirrorTextureBufferGL(long session, long mirrorTexture, java.nio.IntBuffer out_TexId)
Gets a the underlying buffer as a GL texture name.static int
ovr_GetTextureSwapChainBufferGL(long session, long chain, int index, int[] out_TexId)
Array version of:GetTextureSwapChainBufferGL
static int
ovr_GetTextureSwapChainBufferGL(long session, long chain, int index, java.nio.IntBuffer out_TexId)
Get a specific buffer within the chain as a GL texture name.
-
-
-
Method Detail
-
novr_CreateTextureSwapChainGL
public static int novr_CreateTextureSwapChainGL(long session, long desc, long out_TextureSwapChain)
Unsafe version of:CreateTextureSwapChainGL
-
ovr_CreateTextureSwapChainGL
public static int ovr_CreateTextureSwapChainGL(long session, OVRTextureSwapChainDesc desc, org.lwjgl.PointerBuffer out_TextureSwapChain)
Creates a TextureSwapChain suitable for use with OpenGL.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.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.- Parameters:
session
- anovrSession
previously returned byCreate
desc
- the requested texture properties. See notes for more info about texture format.out_TextureSwapChain
- returns the createdovrTextureSwapChain
, which will be valid upon a successful return value, else it will beNULL
. This texture swap chain must be eventually destroyed viaDestroyTextureSwapChain
before destroying the session withDestroy
.- Returns:
- an
ovrResult
indicating success or failure. In the case of failure, useGetLastErrorInfo
to get more information.
-
novr_GetTextureSwapChainBufferGL
public static int novr_GetTextureSwapChainBufferGL(long session, long chain, int index, long out_TexId)
Unsafe version of:GetTextureSwapChainBufferGL
-
ovr_GetTextureSwapChainBufferGL
public static int ovr_GetTextureSwapChainBufferGL(long session, long chain, int index, java.nio.IntBuffer out_TexId)
Get a specific buffer within the chain as a GL texture name.- Parameters:
session
- anovrSession
previously returned byCreate
chain
- anovrTextureSwapChain
previously returned byCreateTextureSwapChainGL
index
- the index within the chain to retrieve. Must be between 0 and length (seeGetTextureSwapChainLength
) or may pass -1 to get the buffer at theCurrentIndex
location. (Saving a call toGetTextureSwapChainCurrentIndex
)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, useGetLastErrorInfo
to get more information.
-
novr_CreateMirrorTextureWithOptionsGL
public static int novr_CreateMirrorTextureWithOptionsGL(long session, long desc, long out_MirrorTexture)
Unsafe version of:CreateMirrorTextureWithOptionsGL
-
ovr_CreateMirrorTextureWithOptionsGL
public static int ovr_CreateMirrorTextureWithOptionsGL(long session, OVRMirrorTextureDesc desc, org.lwjgl.PointerBuffer 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 givenovrSession
before destroying the first one is not supported and will result in an error return.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.- Parameters:
session
- anovrSession
previously returned byCreate
desc
- specifies the requested mirror texture descriptionout_MirrorTexture
- specifies the createdovrMirrorTexture
, which will be valid upon a successful return value, else it will beNULL
. This texture must be eventually destroyed viaDestroyMirrorTexture
before destroying the session withDestroy
.- Returns:
- an
ovrResult
indicating success or failure. In the case of failure, useGetLastErrorInfo
to get more information.
-
novr_CreateMirrorTextureGL
public static int novr_CreateMirrorTextureGL(long session, long desc, long out_MirrorTexture)
Unsafe version of:CreateMirrorTextureGL
-
ovr_CreateMirrorTextureGL
public static int ovr_CreateMirrorTextureGL(long session, OVRMirrorTextureDesc desc, org.lwjgl.PointerBuffer out_MirrorTexture)
Deprecated. UseCreateMirrorTextureWithOptionsGL
instead.Same as
ovr_CreateMirrorTextureWithOptionsGL
except doesn't useovrMirrorOptions
flags as part ofOVRMirrorTextureDesc
'sMirrorOptions
field, and defaults toMirrorOption_PostDistortion
.- Parameters:
session
- anovrSession
previously returned byCreate
desc
- the requested mirror texture descriptionout_MirrorTexture
- returns the createdOVRMirrorTextur
e, which will be valid upon a successful return value, else it will beNULL
. This texture must be eventually destroyed viaDestroyMirrorTexture
before destroying the session withDestroy
.- Returns:
- an
ovrResult
indicating success or failure. In the case of failure, useGetLastErrorInfo
to get more information.
-
novr_GetMirrorTextureBufferGL
public static int novr_GetMirrorTextureBufferGL(long session, long mirrorTexture, long out_TexId)
Unsafe version of:GetMirrorTextureBufferGL
-
ovr_GetMirrorTextureBufferGL
public static int ovr_GetMirrorTextureBufferGL(long session, long mirrorTexture, java.nio.IntBuffer out_TexId)
Gets a the underlying buffer as a GL texture name.- Parameters:
session
- anovrSession
previously returned byCreate
mirrorTexture
- anOVRMirrorTexture
previously returned byCreateMirrorTextureWithOptionsGL
out_TexId
- returns the GL texture object name associated with the mirror texture- Returns:
- an
ovrResult
indicating success or failure. In the case of failure, useGetLastErrorInfo
to get more information.
-
novr_GetTextureSwapChainBufferGL
public static int novr_GetTextureSwapChainBufferGL(long session, long chain, int index, int[] out_TexId)
Array version of:novr_GetTextureSwapChainBufferGL(long, long, int, long)
-
ovr_GetTextureSwapChainBufferGL
public static int ovr_GetTextureSwapChainBufferGL(long session, long chain, int index, int[] out_TexId)
Array version of:GetTextureSwapChainBufferGL
-
novr_GetMirrorTextureBufferGL
public static int novr_GetMirrorTextureBufferGL(long session, long mirrorTexture, int[] out_TexId)
Array version of:novr_GetMirrorTextureBufferGL(long, long, long)
-
ovr_GetMirrorTextureBufferGL
public static int ovr_GetMirrorTextureBufferGL(long session, long mirrorTexture, int[] out_TexId)
Array version of:GetMirrorTextureBufferGL
-
-