Top Description Constructors Methods
org.lwjgl.ovr

public Class OVRGL

extends Object
Class Inheritance
Imports
java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Native bindings to libOVR, using the Oculus SDK C API.

This class contains OpenGL specific functionality.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native int
novr_CreateMirrorTextureGL(long session, long desc, long out_MirrorTexture)

Unsafe version of: CreateMirrorTextureGL

public static native int
novr_CreateMirrorTextureWithOptionsGL(long session, long desc, long out_MirrorTexture)

Unsafe version of: CreateMirrorTextureWithOptionsGL

public static native int
novr_CreateTextureSwapChainGL(long session, long desc, long out_TextureSwapChain)

Unsafe version of: CreateTextureSwapChainGL

public static native int
novr_GetMirrorTextureBufferGL(long session, long mirrorTexture, long out_TexId)

Unsafe version of: GetMirrorTextureBufferGL

public static native int
novr_GetMirrorTextureBufferGL(long session, long mirrorTexture, int[] out_TexId)

Array version of: novr_GetMirrorTextureBufferGL

public static native int
novr_GetTextureSwapChainBufferGL(long session, long chain, int index, long out_TexId)

Unsafe version of: GetTextureSwapChainBufferGL

public static native int
novr_GetTextureSwapChainBufferGL(long session, long chain, int index, int[] out_TexId)

Array version of: novr_GetTextureSwapChainBufferGL

public static int

Returns:

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.
ovr_CreateMirrorTextureGL
(long
an ovrSession previously returned by Create
session
,
OVRMirrorTextureDesc
the requested mirror texture description
desc
,
PointerBuffer
returns the created OVRMirrorTexture, which will be valid upon a successful return value, else it will be NULL. This texture must be eventually destroyed via DestroyMirrorTexture before destroying the session with Destroy.
out_MirrorTexture
)

Deprecated.

public static int

Returns:

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.
ovr_CreateMirrorTextureWithOptionsGL
(long
an ovrSession previously returned by Create
session
,
OVRMirrorTextureDesc
specifies the requested mirror texture description
desc
,
PointerBuffer
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 DestroyMirrorTexture before destroying the session with Destroy.
out_MirrorTexture
)

Creates a Mirror Texture which is auto-refreshed to mirror Rift contents produced by this application.

public static int

Returns:

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.
ovr_CreateTextureSwapChainGL
(long
an ovrSession previously returned by Create
session
,
OVRTextureSwapChainDesc
the requested texture properties. See notes for more info about texture format.
desc
,
PointerBuffer
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 DestroyTextureSwapChain before destroying the session with Destroy.
out_TextureSwapChain
)

Creates a TextureSwapChain suitable for use with OpenGL.

public static int

Returns:

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.
ovr_GetMirrorTextureBufferGL
(long
an ovrSession previously returned by Create
session
,
long
an OVRMirrorTexture previously returned by CreateMirrorTextureWithOptionsGL
mirrorTexture
,
IntBuffer
returns the GL texture object name associated with the mirror texture
out_TexId
)

Gets a the underlying buffer as a GL texture name.

public static int
ovr_GetMirrorTextureBufferGL(long session, long mirrorTexture, int[] out_TexId)

Array version of: GetMirrorTextureBufferGL

public static int

Returns:

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.
ovr_GetTextureSwapChainBufferGL
(long
an ovrSession previously returned by Create
session
,
long
an ovrTextureSwapChain previously returned by CreateTextureSwapChainGL
chain
,
int
the index within the chain to retrieve. Must be between 0 and length (see GetTextureSwapChainLength) or may pass -1 to get the buffer at the CurrentIndex location. (Saving a call to GetTextureSwapChainCurrentIndex)
index
,
IntBuffer
returns the GL texture object name associated with the specific index requested
out_TexId
)

Get a specific buffer within the chain as a GL texture name.

public static int
ovr_GetTextureSwapChainBufferGL(long session, long chain, int index, int[] out_TexId)

Array version of: GetTextureSwapChainBufferGL

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

OVRGLback to summary
protected OVRGL()

Method Detail

novr_CreateMirrorTextureGLback to summary
public static native int novr_CreateMirrorTextureGL(long session, long desc, long out_MirrorTexture)

Unsafe version of: CreateMirrorTextureGL

novr_CreateMirrorTextureWithOptionsGLback to summary
public static native int novr_CreateMirrorTextureWithOptionsGL(long session, long desc, long out_MirrorTexture)

Unsafe version of: CreateMirrorTextureWithOptionsGL

novr_CreateTextureSwapChainGLback to summary
public static native int novr_CreateTextureSwapChainGL(long session, long desc, long out_TextureSwapChain)

Unsafe version of: CreateTextureSwapChainGL

novr_GetMirrorTextureBufferGLback to summary
public static native int novr_GetMirrorTextureBufferGL(long session, long mirrorTexture, long out_TexId)

Unsafe version of: GetMirrorTextureBufferGL

novr_GetMirrorTextureBufferGLback to summary
public static native int novr_GetMirrorTextureBufferGL(long session, long mirrorTexture, int[] out_TexId)

Array version of: novr_GetMirrorTextureBufferGL

novr_GetTextureSwapChainBufferGLback to summary
public static native int novr_GetTextureSwapChainBufferGL(long session, long chain, int index, long out_TexId)

Unsafe version of: GetTextureSwapChainBufferGL

novr_GetTextureSwapChainBufferGLback to summary
public static native int novr_GetTextureSwapChainBufferGL(long session, long chain, int index, int[] out_TexId)

Array version of: novr_GetTextureSwapChainBufferGL

ovr_CreateMirrorTextureGLback to summary
public static int ovr_CreateMirrorTextureGL(long session, OVRMirrorTextureDesc desc, PointerBuffer out_MirrorTexture)

Deprecated. Use CreateMirrorTextureWithOptionsGL instead.

Same as ovr_CreateMirrorTextureWithOptionsGL except doesn't use ovrMirrorOptions flags as part of OVRMirrorTextureDesc's MirrorOptions field, and defaults to MirrorOption_PostDistortion.

Parameters
session:long

an ovrSession previously returned by Create

desc:OVRMirrorTextureDesc

the requested mirror texture description

out_MirrorTexture:PointerBuffer

returns the created OVRMirrorTexture, which will be valid upon a successful return value, else it will be NULL. This texture must be eventually destroyed via DestroyMirrorTexture before destroying the session with Destroy.

Returns:int

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.

Annotations
@NativeType:ovrResult
ovr_CreateMirrorTextureWithOptionsGLback to summary
public static int ovr_CreateMirrorTextureWithOptionsGL(long session, OVRMirrorTextureDesc desc, 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 given ovrSession 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:long

an ovrSession previously returned by Create

desc:OVRMirrorTextureDesc

specifies the requested mirror texture description

out_MirrorTexture:PointerBuffer

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 DestroyMirrorTexture before destroying the session with Destroy.

Returns:int

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.

Annotations
@NativeType:ovrResult
ovr_CreateTextureSwapChainGLback to summary
public static int ovr_CreateTextureSwapChainGL(long session, OVRTextureSwapChainDesc desc, 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:long

an ovrSession previously returned by Create

desc:OVRTextureSwapChainDesc

the requested texture properties. See notes for more info about texture format.

out_TextureSwapChain:PointerBuffer

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 DestroyTextureSwapChain before destroying the session with Destroy.

Returns:int

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.

Annotations
@NativeType:ovrResult
ovr_GetMirrorTextureBufferGLback to summary
public static int ovr_GetMirrorTextureBufferGL(long session, long mirrorTexture, IntBuffer out_TexId)

Gets a the underlying buffer as a GL texture name.

Parameters
session:long

an ovrSession previously returned by Create

mirrorTexture:long

an OVRMirrorTexture previously returned by CreateMirrorTextureWithOptionsGL

out_TexId:IntBuffer

returns the GL texture object name associated with the mirror texture

Returns:int

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.

Annotations
@NativeType:ovrResult
ovr_GetMirrorTextureBufferGLback to summary
public static int ovr_GetMirrorTextureBufferGL(long session, long mirrorTexture, int[] out_TexId)

Array version of: GetMirrorTextureBufferGL

Annotations
@NativeType:ovrResult
ovr_GetTextureSwapChainBufferGLback to summary
public static int ovr_GetTextureSwapChainBufferGL(long session, long chain, int index, IntBuffer out_TexId)

Get a specific buffer within the chain as a GL texture name.

Parameters
session:long

an ovrSession previously returned by Create

chain:long

an ovrTextureSwapChain previously returned by CreateTextureSwapChainGL

index:int

the index within the chain to retrieve. Must be between 0 and length (see GetTextureSwapChainLength) or may pass -1 to get the buffer at the CurrentIndex location. (Saving a call to GetTextureSwapChainCurrentIndex)

out_TexId:IntBuffer

returns the GL texture object name associated with the specific index requested

Returns:int

an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information.

Annotations
@NativeType:ovrResult
ovr_GetTextureSwapChainBufferGLback to summary
public static int ovr_GetTextureSwapChainBufferGL(long session, long chain, int index, int[] out_TexId)

Array version of: GetTextureSwapChainBufferGL

Annotations
@NativeType:ovrResult