com.jogamp.oculusvr.OVR Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jogl Show documentation
Show all versions of jogl Show documentation
Java™ Binding for the OpenGL® API (Atomic Jar files)
/* !---- DO NOT EDIT: This file autogenerated by com/jogamp/gluegen/JavaEmitter.java on Thu Aug 07 00:34:50 CEST 2014 ----! */
package com.jogamp.oculusvr;
import com.jogamp.oculusvr.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
import com.jogamp.gluegen.runtime.*;
import com.jogamp.common.os.*;
import com.jogamp.common.nio.*;
import java.nio.*;
public class OVR {
/** Defined as part of enum type "ovrHmdCaps" */
public static final int ovrHmdCap_Present = 1;
/** Defined as part of enum type "ovrHmdCaps" */
public static final int ovrHmdCap_Available = 2;
/** Defined as part of enum type "ovrHmdCaps" */
public static final int ovrHmdCap_LowPersistence = 128;
/** Defined as part of enum type "ovrHmdCaps" */
public static final int ovrHmdCap_LatencyTest = 256;
/** Defined as part of enum type "ovrHmdCaps" */
public static final int ovrHmdCap_DynamicPrediction = 512;
/** Defined as part of enum type "ovrHmdCaps" */
public static final int ovrHmdCap_NoVSync = 4096;
/** Defined as part of enum type "ovrHmdCaps" */
public static final int ovrHmdCap_NoRestore = 16384;
/** Defined as part of enum type "ovrHmdCaps" */
public static final int ovrHmdCap_Writable_Mask = 4992;
/** Defined as part of enum type "ovrEyeType" */
public static final int ovrEye_Left = 0;
/** Defined as part of enum type "ovrEyeType" */
public static final int ovrEye_Right = 1;
/** Defined as part of enum type "ovrEyeType" */
public static final int ovrEye_Count = 2;
/** Defined as part of enum type "ovrSensorCaps" */
public static final int ovrSensorCap_Orientation = 16;
/** Defined as part of enum type "ovrSensorCaps" */
public static final int ovrSensorCap_YawCorrection = 32;
/** Defined as part of enum type "ovrSensorCaps" */
public static final int ovrSensorCap_Position = 64;
/** Defined as part of enum type "ovrRenderAPIType" */
public static final int ovrRenderAPI_None = 0;
/** Defined as part of enum type "ovrRenderAPIType" */
public static final int ovrRenderAPI_OpenGL = 1;
/** Defined as part of enum type "ovrRenderAPIType" */
public static final int ovrRenderAPI_Android_GLES = 2;
/** Defined as part of enum type "ovrRenderAPIType" */
public static final int ovrRenderAPI_D3D9 = 3;
/** Defined as part of enum type "ovrRenderAPIType" */
public static final int ovrRenderAPI_D3D10 = 4;
/** Defined as part of enum type "ovrRenderAPIType" */
public static final int ovrRenderAPI_D3D11 = 5;
/** Defined as part of enum type "ovrRenderAPIType" */
public static final int ovrRenderAPI_Count = 6;
/** Defined as part of enum type "ovrHmdType" */
public static final int ovrHmd_None = 0;
/** Defined as part of enum type "ovrHmdType" */
public static final int ovrHmd_DK1 = 3;
/** Defined as part of enum type "ovrHmdType" */
public static final int ovrHmd_DKHD = 4;
/** Defined as part of enum type "ovrHmdType" */
public static final int ovrHmd_CrystalCoveProto = 5;
/** Defined as part of enum type "ovrHmdType" */
public static final int ovrHmd_DK2 = 6;
/** Defined as part of enum type "ovrHmdType" */
public static final int ovrHmd_Other = 7;
/** Defined as part of enum type "ovrStatusBits" */
public static final int ovrStatus_OrientationTracked = 1;
/** Defined as part of enum type "ovrStatusBits" */
public static final int ovrStatus_PositionTracked = 2;
/** Defined as part of enum type "ovrStatusBits" */
public static final int ovrStatus_PositionConnected = 32;
/** Defined as part of enum type "ovrStatusBits" */
public static final int ovrStatus_HmdConnected = 128;
/** Defined as part of enum type "ovrDistortionCaps" */
public static final int ovrDistortionCap_Chromatic = 1;
/** Defined as part of enum type "ovrDistortionCaps" */
public static final int ovrDistortionCap_TimeWarp = 2;
/** Defined as part of enum type "ovrDistortionCaps" */
public static final int ovrDistortionCap_Vignette = 8;
public static final float OVR_DEFAULT_PLAYER_HEIGHT = 1.778f;
public static final float OVR_DEFAULT_EYE_HEIGHT = 1.675f;
public static final float OVR_DEFAULT_IPD = 0.064f;
public static final float OVR_DEFAULT_NECK_TO_EYE_HORIZONTAL = 0.12f;
public static final float OVR_DEFAULT_NECK_TO_EYE_VERTICAL = 0.12f;
/** Interface to C language function:
ovrPosef ovrHmd_BeginEyeRender(ovrHmd hmd, ovrEyeType eye)
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
public static ovrPosef ovrHmd_BeginEyeRender(OvrHmdContext hmd, int eye) {
final ByteBuffer _res;
_res = ovrHmd_BeginEyeRender1(((hmd == null) ? null : hmd.getBuffer()), eye);
if (_res == null) return null;
return ovrPosef.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrPosef ovrHmd_BeginEyeRender(ovrHmd hmd, ovrEyeType eye)
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
private static native ByteBuffer ovrHmd_BeginEyeRender1(ByteBuffer hmd, int eye);
/** Interface to C language function:
ovrFrameTiming ovrHmd_BeginFrame(ovrHmd hmd, unsigned int frameIndex)
*/
public static ovrFrameTiming ovrHmd_BeginFrame(OvrHmdContext hmd, int frameIndex) {
final ByteBuffer _res;
_res = ovrHmd_BeginFrame1(((hmd == null) ? null : hmd.getBuffer()), frameIndex);
if (_res == null) return null;
return ovrFrameTiming.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrFrameTiming ovrHmd_BeginFrame(ovrHmd hmd, unsigned int frameIndex)
*/
private static native ByteBuffer ovrHmd_BeginFrame1(ByteBuffer hmd, int frameIndex);
/** Interface to C language function:
ovrFrameTiming ovrHmd_BeginFrameTiming(ovrHmd hmd, unsigned int frameIndex)
*/
public static ovrFrameTiming ovrHmd_BeginFrameTiming(OvrHmdContext hmd, int frameIndex) {
final ByteBuffer _res;
_res = ovrHmd_BeginFrameTiming1(((hmd == null) ? null : hmd.getBuffer()), frameIndex);
if (_res == null) return null;
return ovrFrameTiming.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrFrameTiming ovrHmd_BeginFrameTiming(ovrHmd hmd, unsigned int frameIndex)
*/
private static native ByteBuffer ovrHmd_BeginFrameTiming1(ByteBuffer hmd, int frameIndex);
/** Interface to C language function:
ovrBool ovrHmd_ConfigureRendering(ovrHmd hmd, const ovrRenderAPIConfig * apiConfig, unsigned int distortionCaps, const ovrFovPort eyeFovIn[2], ovrEyeRenderDesc eyeRenderDescOut[2])
*/
public static boolean ovrHmd_ConfigureRendering(OvrHmdContext hmd, ovrRenderAPIConfig apiConfig, int distortionCaps, ovrFovPort[] eyeFovIn, ovrEyeRenderDesc[] eyeRenderDescOut) {
if ( eyeFovIn.length < 2)
throw new OVRException("Array \"eyeFovIn\" length (" + eyeFovIn.length+ ") was less than the required (2)");
if ( eyeRenderDescOut.length < 2)
throw new OVRException("Array \"eyeRenderDescOut\" length (" + eyeRenderDescOut.length+ ") was less than the required (2)");
final ByteBuffer[] eyeFovIn_buf_array_copy = new ByteBuffer[eyeFovIn.length];
for (int _ctr = 0; _ctr < + eyeFovIn.length; _ctr++) {
ovrFovPort _tmp = eyeFovIn[_ctr];
eyeFovIn_buf_array_copy[_ctr] = ((_tmp == null) ? null : _tmp.getBuffer());
}
final ByteBuffer[] eyeRenderDescOut_buf_array_copy = new ByteBuffer[eyeRenderDescOut.length];
for (int _ctr = 0; _ctr < + eyeRenderDescOut.length; _ctr++) {
ovrEyeRenderDesc _tmp = eyeRenderDescOut[_ctr];
eyeRenderDescOut_buf_array_copy[_ctr] = ((_tmp == null) ? null : _tmp.getBuffer());
}
final boolean _res;
_res = ovrHmd_ConfigureRendering1(((hmd == null) ? null : hmd.getBuffer()), ((apiConfig == null) ? null : apiConfig.getBuffer()), distortionCaps, eyeFovIn_buf_array_copy, eyeRenderDescOut_buf_array_copy);
for (int _ctr = 0; _ctr < eyeRenderDescOut.length; _ctr++) {
if ((eyeRenderDescOut[_ctr] == null && eyeRenderDescOut_buf_array_copy[_ctr] == null) ||
(eyeRenderDescOut[_ctr] != null && eyeRenderDescOut[_ctr].getBuffer() == eyeRenderDescOut_buf_array_copy[_ctr])) {
// No copy back needed
} else {
if (eyeRenderDescOut_buf_array_copy[_ctr] == null) {
eyeRenderDescOut[_ctr] = null;
} else {
eyeRenderDescOut[_ctr] = ovrEyeRenderDesc.create(eyeRenderDescOut_buf_array_copy[_ctr]);
}
}
}
return _res;
}
/** Entry point to C language function: ovrBool ovrHmd_ConfigureRendering(ovrHmd hmd, const ovrRenderAPIConfig * apiConfig, unsigned int distortionCaps, const ovrFovPort eyeFovIn[2], ovrEyeRenderDesc eyeRenderDescOut[2])
*/
private static native boolean ovrHmd_ConfigureRendering1(ByteBuffer hmd, ByteBuffer apiConfig, int distortionCaps, ByteBuffer[] eyeFovIn, ByteBuffer[] eyeRenderDescOut);
/** Interface to C language function:
ovrHmd ovrHmd_Create(int index)
*/
public static OvrHmdContext ovrHmd_Create(int index) {
if( !isAvailable() ) { return null; }
final ByteBuffer _res;
_res = ovrHmd_Create1(index);
if (_res == null) return null;
return OvrHmdContext.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrHmd ovrHmd_Create(int index)
*/
private static native ByteBuffer ovrHmd_Create1(int index);
/** Interface to C language function:
ovrHmd ovrHmd_CreateDebug(ovrHmdType type)
@param type valid values are: ovrHmd_None, ovrHmd_DK1, ovrHmd_DKHD, ovrHmd_CrystalCoveProto, ovrHmd_DK2, ovrHmd_Other
*/
public static OvrHmdContext ovrHmd_CreateDebug(int type) {
if( !isAvailable() ) { return null; }
final ByteBuffer _res;
_res = ovrHmd_CreateDebug1(type);
if (_res == null) return null;
return OvrHmdContext.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrHmd ovrHmd_CreateDebug(ovrHmdType type)
@param type valid values are: ovrHmd_None, ovrHmd_DK1, ovrHmd_DKHD, ovrHmd_CrystalCoveProto, ovrHmd_DK2, ovrHmd_Other
*/
private static native ByteBuffer ovrHmd_CreateDebug1(int type);
/** Interface to C language function:
ovrBool ovrHmd_CreateDistortionMesh(ovrHmd hmd, ovrEyeType eyeType, ovrFovPort fov, unsigned int distortionCaps, ovrDistortionMesh * meshData)
@param eyeType valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
public static boolean ovrHmd_CreateDistortionMesh(OvrHmdContext hmd, int eyeType, ovrFovPort fov, int distortionCaps, ovrDistortionMesh meshData) {
return ovrHmd_CreateDistortionMesh1(((hmd == null) ? null : hmd.getBuffer()), eyeType, ((fov == null) ? null : fov.getBuffer()), distortionCaps, ((meshData == null) ? null : meshData.getBuffer()));
}
/** Entry point to C language function: ovrBool ovrHmd_CreateDistortionMesh(ovrHmd hmd, ovrEyeType eyeType, ovrFovPort fov, unsigned int distortionCaps, ovrDistortionMesh * meshData)
@param eyeType valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
private static native boolean ovrHmd_CreateDistortionMesh1(ByteBuffer hmd, int eyeType, ByteBuffer fov, int distortionCaps, ByteBuffer meshData);
/** Interface to C language function:
void ovrHmd_Destroy(ovrHmd hmd)
*/
public static void ovrHmd_Destroy(OvrHmdContext hmd) {
ovrHmd_Destroy1(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: void ovrHmd_Destroy(ovrHmd hmd)
*/
private static native void ovrHmd_Destroy1(ByteBuffer hmd);
/** Interface to C language function:
void ovrHmd_DestroyDistortionMesh(ovrDistortionMesh * meshData)
*/
public static void ovrHmd_DestroyDistortionMesh(ovrDistortionMesh meshData) {
ovrHmd_DestroyDistortionMesh1(((meshData == null) ? null : meshData.getBuffer()));
}
/** Entry point to C language function: void ovrHmd_DestroyDistortionMesh(ovrDistortionMesh * meshData)
*/
private static native void ovrHmd_DestroyDistortionMesh1(ByteBuffer meshData);
/** Interface to C language function:
int ovrHmd_Detect()
*/
public static native int ovrHmd_Detect();
/** Interface to C language function:
void ovrHmd_EndEyeRender(ovrHmd hmd, ovrEyeType eye, ovrPosef renderPose, ovrTexture * eyeTexture)
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
public static void ovrHmd_EndEyeRender(OvrHmdContext hmd, int eye, ovrPosef renderPose, ovrTexture eyeTexture) {
ovrHmd_EndEyeRender1(((hmd == null) ? null : hmd.getBuffer()), eye, ((renderPose == null) ? null : renderPose.getBuffer()), ((eyeTexture == null) ? null : eyeTexture.getBuffer()));
}
/** Entry point to C language function: void ovrHmd_EndEyeRender(ovrHmd hmd, ovrEyeType eye, ovrPosef renderPose, ovrTexture * eyeTexture)
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
private static native void ovrHmd_EndEyeRender1(ByteBuffer hmd, int eye, ByteBuffer renderPose, ByteBuffer eyeTexture);
/** Interface to C language function:
void ovrHmd_EndFrame(ovrHmd hmd)
*/
public static void ovrHmd_EndFrame(OvrHmdContext hmd) {
ovrHmd_EndFrame1(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: void ovrHmd_EndFrame(ovrHmd hmd)
*/
private static native void ovrHmd_EndFrame1(ByteBuffer hmd);
/** Interface to C language function:
void ovrHmd_EndFrameTiming(ovrHmd hmd)
*/
public static void ovrHmd_EndFrameTiming(OvrHmdContext hmd) {
ovrHmd_EndFrameTiming1(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: void ovrHmd_EndFrameTiming(ovrHmd hmd)
*/
private static native void ovrHmd_EndFrameTiming1(ByteBuffer hmd);
/** Interface to C language function:
unsigned int ovrHmd_GetArraySize(ovrHmd hmd, const char * propertyName)
*/
public static int ovrHmd_GetArraySize(OvrHmdContext hmd, String propertyName) {
return ovrHmd_GetArraySize1(((hmd == null) ? null : hmd.getBuffer()), propertyName);
}
/** Entry point to C language function: unsigned int ovrHmd_GetArraySize(ovrHmd hmd, const char * propertyName)
*/
private static native int ovrHmd_GetArraySize1(ByteBuffer hmd, String propertyName);
/** Interface to C language function:
void ovrHmd_GetDesc(ovrHmd hmd, ovrHmdDesc * desc)
*/
public static void ovrHmd_GetDesc(OvrHmdContext hmd, ovrHmdDesc desc) {
ovrHmd_GetDesc1(((hmd == null) ? null : hmd.getBuffer()), ((desc == null) ? null : desc.getBuffer()));
}
/** Entry point to C language function: void ovrHmd_GetDesc(ovrHmd hmd, ovrHmdDesc * desc)
*/
private static native void ovrHmd_GetDesc1(ByteBuffer hmd, ByteBuffer desc);
/** Interface to C language function:
unsigned int ovrHmd_GetEnabledCaps(ovrHmd hmd)
*/
public static int ovrHmd_GetEnabledCaps(OvrHmdContext hmd) {
return ovrHmd_GetEnabledCaps1(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: unsigned int ovrHmd_GetEnabledCaps(ovrHmd hmd)
*/
private static native int ovrHmd_GetEnabledCaps1(ByteBuffer hmd);
/** Interface to C language function:
ovrPosef ovrHmd_GetEyePose(ovrHmd hmd, ovrEyeType eye)
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
public static ovrPosef ovrHmd_GetEyePose(OvrHmdContext hmd, int eye) {
final ByteBuffer _res;
_res = ovrHmd_GetEyePose1(((hmd == null) ? null : hmd.getBuffer()), eye);
if (_res == null) return null;
return ovrPosef.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrPosef ovrHmd_GetEyePose(ovrHmd hmd, ovrEyeType eye)
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
private static native ByteBuffer ovrHmd_GetEyePose1(ByteBuffer hmd, int eye);
/** Interface to C language function:
void ovrHmd_GetEyeTimewarpMatrices(ovrHmd hmd, ovrEyeType eye, ovrPosef renderPose, ovrMatrix4f twmOut[2])
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
public static void ovrHmd_GetEyeTimewarpMatrices(OvrHmdContext hmd, int eye, ovrPosef renderPose, ovrMatrix4f[] twmOut) {
if ( twmOut.length < 2)
throw new OVRException("Array \"twmOut\" length (" + twmOut.length+ ") was less than the required (2)");
final ByteBuffer[] twmOut_buf_array_copy = new ByteBuffer[twmOut.length];
for (int _ctr = 0; _ctr < + twmOut.length; _ctr++) {
ovrMatrix4f _tmp = twmOut[_ctr];
twmOut_buf_array_copy[_ctr] = ((_tmp == null) ? null : _tmp.getBuffer());
}
ovrHmd_GetEyeTimewarpMatrices1(((hmd == null) ? null : hmd.getBuffer()), eye, ((renderPose == null) ? null : renderPose.getBuffer()), twmOut_buf_array_copy);
for (int _ctr = 0; _ctr < twmOut.length; _ctr++) {
if ((twmOut[_ctr] == null && twmOut_buf_array_copy[_ctr] == null) ||
(twmOut[_ctr] != null && twmOut[_ctr].getBuffer() == twmOut_buf_array_copy[_ctr])) {
// No copy back needed
} else {
if (twmOut_buf_array_copy[_ctr] == null) {
twmOut[_ctr] = null;
} else {
twmOut[_ctr] = ovrMatrix4f.create(twmOut_buf_array_copy[_ctr]);
}
}
}
}
/** Entry point to C language function: void ovrHmd_GetEyeTimewarpMatrices(ovrHmd hmd, ovrEyeType eye, ovrPosef renderPose, ovrMatrix4f twmOut[2])
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
private static native void ovrHmd_GetEyeTimewarpMatrices1(ByteBuffer hmd, int eye, ByteBuffer renderPose, ByteBuffer[] twmOut);
/** Interface to C language function:
float ovrHmd_GetFloat(ovrHmd hmd, const char * propertyName, float defaultVal)
*/
public static float ovrHmd_GetFloat(OvrHmdContext hmd, String propertyName, float defaultVal) {
return ovrHmd_GetFloat1(((hmd == null) ? null : hmd.getBuffer()), propertyName, defaultVal);
}
/** Entry point to C language function: float ovrHmd_GetFloat(ovrHmd hmd, const char * propertyName, float defaultVal)
*/
private static native float ovrHmd_GetFloat1(ByteBuffer hmd, String propertyName, float defaultVal);
/** Interface to C language function:
unsigned int ovrHmd_GetFloatArray(ovrHmd hmd, const char * propertyName, float * values, unsigned int arraySize)
@param values a direct or array-backed {@link java.nio.FloatBuffer} */
public static int ovrHmd_GetFloatArray(OvrHmdContext hmd, String propertyName, FloatBuffer values, int arraySize) {
final boolean values_is_direct = Buffers.isDirect(values);
return ovrHmd_GetFloatArray1(((hmd == null) ? null : hmd.getBuffer()), propertyName, values_is_direct ? values : Buffers.getArray(values), values_is_direct ? Buffers.getDirectBufferByteOffset(values) : Buffers.getIndirectBufferByteOffset(values), values_is_direct, arraySize);
}
/** Entry point to C language function: unsigned int ovrHmd_GetFloatArray(ovrHmd hmd, const char * propertyName, float * values, unsigned int arraySize)
@param values a direct or array-backed {@link java.nio.FloatBuffer} */
private static native int ovrHmd_GetFloatArray1(ByteBuffer hmd, String propertyName, Object values, int values_byte_offset, boolean values_is_direct, int arraySize);
/** Interface to C language function:
unsigned int ovrHmd_GetFloatArray(ovrHmd hmd, const char * propertyName, float * values, unsigned int arraySize)
*/
public static int ovrHmd_GetFloatArray(OvrHmdContext hmd, String propertyName, float[] values, int values_offset, int arraySize) {
if(values != null && values.length <= values_offset)
throw new OVRException("array offset argument \"values_offset\" (" + values_offset + ") equals or exceeds array length (" + values.length + ")");
return ovrHmd_GetFloatArray1(((hmd == null) ? null : hmd.getBuffer()), propertyName, values, Buffers.SIZEOF_FLOAT * values_offset, false, arraySize);
}
/** Interface to C language function:
ovrSizei ovrHmd_GetFovTextureSize(ovrHmd hmd, ovrEyeType eye, ovrFovPort fov, float pixelsPerDisplayPixel)
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
public static ovrSizei ovrHmd_GetFovTextureSize(OvrHmdContext hmd, int eye, ovrFovPort fov, float pixelsPerDisplayPixel) {
final ByteBuffer _res;
_res = ovrHmd_GetFovTextureSize1(((hmd == null) ? null : hmd.getBuffer()), eye, ((fov == null) ? null : fov.getBuffer()), pixelsPerDisplayPixel);
if (_res == null) return null;
return ovrSizei.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrSizei ovrHmd_GetFovTextureSize(ovrHmd hmd, ovrEyeType eye, ovrFovPort fov, float pixelsPerDisplayPixel)
@param eye valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
private static native ByteBuffer ovrHmd_GetFovTextureSize1(ByteBuffer hmd, int eye, ByteBuffer fov, float pixelsPerDisplayPixel);
/** Interface to C language function:
ovrFrameTiming ovrHmd_GetFrameTiming(ovrHmd hmd, unsigned int frameIndex)
*/
public static ovrFrameTiming ovrHmd_GetFrameTiming(OvrHmdContext hmd, int frameIndex) {
final ByteBuffer _res;
_res = ovrHmd_GetFrameTiming1(((hmd == null) ? null : hmd.getBuffer()), frameIndex);
if (_res == null) return null;
return ovrFrameTiming.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrFrameTiming ovrHmd_GetFrameTiming(ovrHmd hmd, unsigned int frameIndex)
*/
private static native ByteBuffer ovrHmd_GetFrameTiming1(ByteBuffer hmd, int frameIndex);
/** Interface to C language function:
const char * ovrHmd_GetLastError(ovrHmd hmd)
*/
public static String ovrHmd_GetLastError(OvrHmdContext hmd) {
return ovrHmd_GetLastError1(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: const char * ovrHmd_GetLastError(ovrHmd hmd)
*/
private static native String ovrHmd_GetLastError1(ByteBuffer hmd);
/** Interface to C language function:
const char * ovrHmd_GetLatencyTestResult(ovrHmd hmd)
*/
public static String ovrHmd_GetLatencyTestResult(OvrHmdContext hmd) {
return ovrHmd_GetLatencyTestResult1(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: const char * ovrHmd_GetLatencyTestResult(ovrHmd hmd)
*/
private static native String ovrHmd_GetLatencyTestResult1(ByteBuffer hmd);
/** Interface to C language function:
double ovrHmd_GetMeasuredLatencyTest2(ovrHmd hmd)
*/
public static double ovrHmd_GetMeasuredLatencyTest2(OvrHmdContext hmd) {
return ovrHmd_GetMeasuredLatencyTest21(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: double ovrHmd_GetMeasuredLatencyTest2(ovrHmd hmd)
*/
private static native double ovrHmd_GetMeasuredLatencyTest21(ByteBuffer hmd);
/** Interface to C language function:
ovrEyeRenderDesc ovrHmd_GetRenderDesc(ovrHmd hmd, ovrEyeType eyeType, ovrFovPort fov)
@param eyeType valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
public static ovrEyeRenderDesc ovrHmd_GetRenderDesc(OvrHmdContext hmd, int eyeType, ovrFovPort fov) {
final ByteBuffer _res;
_res = ovrHmd_GetRenderDesc1(((hmd == null) ? null : hmd.getBuffer()), eyeType, ((fov == null) ? null : fov.getBuffer()));
if (_res == null) return null;
return ovrEyeRenderDesc.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrEyeRenderDesc ovrHmd_GetRenderDesc(ovrHmd hmd, ovrEyeType eyeType, ovrFovPort fov)
@param eyeType valid values are: ovrEye_Left, ovrEye_Right, ovrEye_Count
*/
private static native ByteBuffer ovrHmd_GetRenderDesc1(ByteBuffer hmd, int eyeType, ByteBuffer fov);
/** Interface to C language function:
void ovrHmd_GetRenderScaleAndOffset(ovrFovPort fov, ovrSizei textureSize, ovrRecti renderViewport, ovrVector2f uvScaleOffsetOut[2])
*/
public static void ovrHmd_GetRenderScaleAndOffset(ovrFovPort fov, ovrSizei textureSize, ovrRecti renderViewport, ovrVector2f[] uvScaleOffsetOut) {
if ( uvScaleOffsetOut.length < 2)
throw new OVRException("Array \"uvScaleOffsetOut\" length (" + uvScaleOffsetOut.length+ ") was less than the required (2)");
final ByteBuffer[] uvScaleOffsetOut_buf_array_copy = new ByteBuffer[uvScaleOffsetOut.length];
for (int _ctr = 0; _ctr < + uvScaleOffsetOut.length; _ctr++) {
ovrVector2f _tmp = uvScaleOffsetOut[_ctr];
uvScaleOffsetOut_buf_array_copy[_ctr] = ((_tmp == null) ? null : _tmp.getBuffer());
}
ovrHmd_GetRenderScaleAndOffset1(((fov == null) ? null : fov.getBuffer()), ((textureSize == null) ? null : textureSize.getBuffer()), ((renderViewport == null) ? null : renderViewport.getBuffer()), uvScaleOffsetOut_buf_array_copy);
for (int _ctr = 0; _ctr < uvScaleOffsetOut.length; _ctr++) {
if ((uvScaleOffsetOut[_ctr] == null && uvScaleOffsetOut_buf_array_copy[_ctr] == null) ||
(uvScaleOffsetOut[_ctr] != null && uvScaleOffsetOut[_ctr].getBuffer() == uvScaleOffsetOut_buf_array_copy[_ctr])) {
// No copy back needed
} else {
if (uvScaleOffsetOut_buf_array_copy[_ctr] == null) {
uvScaleOffsetOut[_ctr] = null;
} else {
uvScaleOffsetOut[_ctr] = ovrVector2f.create(uvScaleOffsetOut_buf_array_copy[_ctr]);
}
}
}
}
/** Entry point to C language function: void ovrHmd_GetRenderScaleAndOffset(ovrFovPort fov, ovrSizei textureSize, ovrRecti renderViewport, ovrVector2f uvScaleOffsetOut[2])
*/
private static native void ovrHmd_GetRenderScaleAndOffset1(ByteBuffer fov, ByteBuffer textureSize, ByteBuffer renderViewport, ByteBuffer[] uvScaleOffsetOut);
/** Interface to C language function:
ovrBool ovrHmd_GetSensorDesc(ovrHmd hmd, ovrSensorDesc * descOut)
*/
public static boolean ovrHmd_GetSensorDesc(OvrHmdContext hmd, ovrSensorDesc descOut) {
return ovrHmd_GetSensorDesc1(((hmd == null) ? null : hmd.getBuffer()), ((descOut == null) ? null : descOut.getBuffer()));
}
/** Entry point to C language function: ovrBool ovrHmd_GetSensorDesc(ovrHmd hmd, ovrSensorDesc * descOut)
*/
private static native boolean ovrHmd_GetSensorDesc1(ByteBuffer hmd, ByteBuffer descOut);
/** Interface to C language function:
ovrSensorState ovrHmd_GetSensorState(ovrHmd hmd, double absTime)
*/
public static ovrSensorState ovrHmd_GetSensorState(OvrHmdContext hmd, double absTime) {
final ByteBuffer _res;
_res = ovrHmd_GetSensorState1(((hmd == null) ? null : hmd.getBuffer()), absTime);
if (_res == null) return null;
return ovrSensorState.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrSensorState ovrHmd_GetSensorState(ovrHmd hmd, double absTime)
*/
private static native ByteBuffer ovrHmd_GetSensorState1(ByteBuffer hmd, double absTime);
/** Interface to C language function:
const char * ovrHmd_GetString(ovrHmd hmd, const char * propertyName, const char * defaultVal)
@param propertyName a direct or array-backed {@link java.nio.ByteBuffer}
@param defaultVal a direct or array-backed {@link java.nio.ByteBuffer} */
public static String ovrHmd_GetString(OvrHmdContext hmd, ByteBuffer propertyName, ByteBuffer defaultVal) {
final boolean propertyName_is_direct = Buffers.isDirect(propertyName);
final boolean defaultVal_is_direct = Buffers.isDirect(defaultVal);
return ovrHmd_GetString1(((hmd == null) ? null : hmd.getBuffer()), propertyName_is_direct ? propertyName : Buffers.getArray(propertyName), propertyName_is_direct ? Buffers.getDirectBufferByteOffset(propertyName) : Buffers.getIndirectBufferByteOffset(propertyName), propertyName_is_direct, defaultVal_is_direct ? defaultVal : Buffers.getArray(defaultVal), defaultVal_is_direct ? Buffers.getDirectBufferByteOffset(defaultVal) : Buffers.getIndirectBufferByteOffset(defaultVal), defaultVal_is_direct);
}
/** Entry point to C language function: const char * ovrHmd_GetString(ovrHmd hmd, const char * propertyName, const char * defaultVal)
@param propertyName a direct or array-backed {@link java.nio.ByteBuffer}
@param defaultVal a direct or array-backed {@link java.nio.ByteBuffer} */
private static native String ovrHmd_GetString1(ByteBuffer hmd, Object propertyName, int propertyName_byte_offset, boolean propertyName_is_direct, Object defaultVal, int defaultVal_byte_offset, boolean defaultVal_is_direct);
/** Interface to C language function:
const char * ovrHmd_GetString(ovrHmd hmd, const char * propertyName, const char * defaultVal)
*/
public static String ovrHmd_GetString(OvrHmdContext hmd, byte[] propertyName, int propertyName_offset, byte[] defaultVal, int defaultVal_offset) {
if(propertyName != null && propertyName.length <= propertyName_offset)
throw new OVRException("array offset argument \"propertyName_offset\" (" + propertyName_offset + ") equals or exceeds array length (" + propertyName.length + ")");
if(defaultVal != null && defaultVal.length <= defaultVal_offset)
throw new OVRException("array offset argument \"defaultVal_offset\" (" + defaultVal_offset + ") equals or exceeds array length (" + defaultVal.length + ")");
return ovrHmd_GetString1(((hmd == null) ? null : hmd.getBuffer()), propertyName, propertyName_offset, false, defaultVal, defaultVal_offset, false);
}
/** Interface to C language function:
void ovrHmd_ResetFrameTiming(ovrHmd hmd, unsigned int frameIndex)
*/
public static void ovrHmd_ResetFrameTiming(OvrHmdContext hmd, int frameIndex) {
ovrHmd_ResetFrameTiming1(((hmd == null) ? null : hmd.getBuffer()), frameIndex);
}
/** Entry point to C language function: void ovrHmd_ResetFrameTiming(ovrHmd hmd, unsigned int frameIndex)
*/
private static native void ovrHmd_ResetFrameTiming1(ByteBuffer hmd, int frameIndex);
/** Interface to C language function:
void ovrHmd_ResetSensor(ovrHmd hmd)
*/
public static void ovrHmd_ResetSensor(OvrHmdContext hmd) {
ovrHmd_ResetSensor1(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: void ovrHmd_ResetSensor(ovrHmd hmd)
*/
private static native void ovrHmd_ResetSensor1(ByteBuffer hmd);
/** Interface to C language function:
void ovrHmd_SetEnabledCaps(ovrHmd hmd, unsigned int hmdCaps)
*/
public static void ovrHmd_SetEnabledCaps(OvrHmdContext hmd, int hmdCaps) {
ovrHmd_SetEnabledCaps1(((hmd == null) ? null : hmd.getBuffer()), hmdCaps);
}
/** Entry point to C language function: void ovrHmd_SetEnabledCaps(ovrHmd hmd, unsigned int hmdCaps)
*/
private static native void ovrHmd_SetEnabledCaps1(ByteBuffer hmd, int hmdCaps);
/** Interface to C language function:
ovrBool ovrHmd_SetFloat(ovrHmd hmd, const char * propertyName, float value)
*/
public static boolean ovrHmd_SetFloat(OvrHmdContext hmd, String propertyName, float value) {
return ovrHmd_SetFloat1(((hmd == null) ? null : hmd.getBuffer()), propertyName, value);
}
/** Entry point to C language function: ovrBool ovrHmd_SetFloat(ovrHmd hmd, const char * propertyName, float value)
*/
private static native boolean ovrHmd_SetFloat1(ByteBuffer hmd, String propertyName, float value);
/** Interface to C language function:
ovrBool ovrHmd_SetFloatArray(ovrHmd hmd, const char * propertyName, float * values, unsigned int arraySize)
@param values a direct or array-backed {@link java.nio.FloatBuffer} */
public static boolean ovrHmd_SetFloatArray(OvrHmdContext hmd, String propertyName, FloatBuffer values, int arraySize) {
final boolean values_is_direct = Buffers.isDirect(values);
return ovrHmd_SetFloatArray1(((hmd == null) ? null : hmd.getBuffer()), propertyName, values_is_direct ? values : Buffers.getArray(values), values_is_direct ? Buffers.getDirectBufferByteOffset(values) : Buffers.getIndirectBufferByteOffset(values), values_is_direct, arraySize);
}
/** Entry point to C language function: ovrBool ovrHmd_SetFloatArray(ovrHmd hmd, const char * propertyName, float * values, unsigned int arraySize)
@param values a direct or array-backed {@link java.nio.FloatBuffer} */
private static native boolean ovrHmd_SetFloatArray1(ByteBuffer hmd, String propertyName, Object values, int values_byte_offset, boolean values_is_direct, int arraySize);
/** Interface to C language function:
ovrBool ovrHmd_SetFloatArray(ovrHmd hmd, const char * propertyName, float * values, unsigned int arraySize)
*/
public static boolean ovrHmd_SetFloatArray(OvrHmdContext hmd, String propertyName, float[] values, int values_offset, int arraySize) {
if(values != null && values.length <= values_offset)
throw new OVRException("array offset argument \"values_offset\" (" + values_offset + ") equals or exceeds array length (" + values.length + ")");
return ovrHmd_SetFloatArray1(((hmd == null) ? null : hmd.getBuffer()), propertyName, values, Buffers.SIZEOF_FLOAT * values_offset, false, arraySize);
}
/** Interface to C language function:
ovrBool ovrHmd_StartSensor(ovrHmd hmd, unsigned int supportedSensorCaps, unsigned int requiredSensorCaps)
*/
public static boolean ovrHmd_StartSensor(OvrHmdContext hmd, int supportedSensorCaps, int requiredSensorCaps) {
return ovrHmd_StartSensor1(((hmd == null) ? null : hmd.getBuffer()), supportedSensorCaps, requiredSensorCaps);
}
/** Entry point to C language function: ovrBool ovrHmd_StartSensor(ovrHmd hmd, unsigned int supportedSensorCaps, unsigned int requiredSensorCaps)
*/
private static native boolean ovrHmd_StartSensor1(ByteBuffer hmd, int supportedSensorCaps, int requiredSensorCaps);
/** Interface to C language function:
void ovrHmd_StopSensor(ovrHmd hmd)
*/
public static void ovrHmd_StopSensor(OvrHmdContext hmd) {
ovrHmd_StopSensor1(((hmd == null) ? null : hmd.getBuffer()));
}
/** Entry point to C language function: void ovrHmd_StopSensor(ovrHmd hmd)
*/
private static native void ovrHmd_StopSensor1(ByteBuffer hmd);
/** Interface to C language function:
ovrMatrix4f ovrMatrix4f_OrthoSubProjection(ovrMatrix4f projection, ovrVector2f orthoScale, float orthoDistance, float eyeViewAdjustX)
*/
public static ovrMatrix4f ovrMatrix4f_OrthoSubProjection(ovrMatrix4f projection, ovrVector2f orthoScale, float orthoDistance, float eyeViewAdjustX) {
final ByteBuffer _res;
_res = ovrMatrix4f_OrthoSubProjection1(((projection == null) ? null : projection.getBuffer()), ((orthoScale == null) ? null : orthoScale.getBuffer()), orthoDistance, eyeViewAdjustX);
if (_res == null) return null;
return ovrMatrix4f.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrMatrix4f ovrMatrix4f_OrthoSubProjection(ovrMatrix4f projection, ovrVector2f orthoScale, float orthoDistance, float eyeViewAdjustX)
*/
private static native ByteBuffer ovrMatrix4f_OrthoSubProjection1(ByteBuffer projection, ByteBuffer orthoScale, float orthoDistance, float eyeViewAdjustX);
/** Interface to C language function:
ovrMatrix4f ovrMatrix4f_Projection(ovrFovPort fov, float znear, float zfar, ovrBool rightHanded)
*/
public static ovrMatrix4f ovrMatrix4f_Projection(ovrFovPort fov, float znear, float zfar, boolean rightHanded) {
final ByteBuffer _res;
_res = ovrMatrix4f_Projection1(((fov == null) ? null : fov.getBuffer()), znear, zfar, rightHanded);
if (_res == null) return null;
return ovrMatrix4f.create(Buffers.nativeOrder(_res));
}
/** Entry point to C language function: ovrMatrix4f ovrMatrix4f_Projection(ovrFovPort fov, float znear, float zfar, ovrBool rightHanded)
*/
private static native ByteBuffer ovrMatrix4f_Projection1(ByteBuffer fov, float znear, float zfar, boolean rightHanded);
/** Interface to C language function:
double ovr_GetTimeInSeconds()
*/
public static native double ovr_GetTimeInSeconds();
/** Interface to C language function:
ovrBool ovr_Initialize()
*/
public static boolean ovr_Initialize() {
if( !isAvailable() ) { return false; }
return ovr_Initialize1();
}
/** Entry point to C language function: ovrBool ovr_Initialize()
*/
private static native boolean ovr_Initialize1();
/** Interface to C language function:
void ovr_Shutdown()
*/
public static native void ovr_Shutdown();
/** Interface to C language function:
double ovr_WaitTillTime(double absTime)
*/
public static native double ovr_WaitTillTime(double absTime);
// --- Begin CustomJavaCode .cfg declarations
static final DynamicLibraryBundle dynamicLookupHelper;
static {
dynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction() {
public DynamicLibraryBundle run() {
final DynamicLibraryBundle bundle = new DynamicLibraryBundle(new OVRDynamicLibraryBundleInfo());
if(null==bundle) {
throw new RuntimeException("Null DynamicLibraryBundle");
}
/** No native tool library to load
if(!bundle.isToolLibLoaded()) {
System.err.println("Couln't load native OVR/JNI glue library");
return null;
} */
if(!bundle.isLibComplete()) {
System.err.println("Couln't load native OVR/JNI glue library");
return null;
}
if( !initializeImpl() ) {
System.err.println("Native initialization failure of OVR/JNI glue library");
return null;
}
return bundle;
} } );
}
/**
* Accessor.
* @returns true if OVR library is available on this machine.
*/
public static boolean isAvailable() { return dynamicLookupHelper != null; }
// ---- End CustomJavaCode .cfg declarations
private static native boolean initializeImpl();
private static native int getCStringLengthImpl(final long pString);
} // end of class OVR