Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@comex
Created April 12, 2016 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save comex/6768751e27b89aa8b1b08b654af2d39e to your computer and use it in GitHub Desktop.
Save comex/6768751e27b89aa8b1b08b654af2d39e to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <stdio.h>
#include "OVR_CAPI.h"
int main()
{
ovrResult result = ovr_Initialize(NULL);
if (OVR_FAILURE(result)) {
ovrErrorInfo errorInfo;
ovr_GetLastErrorInfo(&errorInfo);
printf("ovr_Initialize failed: %d / %s", errorInfo.Result, errorInfo.ErrorString);
return 1;
}
printf("SDK version: %s\n", ovr_GetVersionString());
ovrSession sess;
ovrGraphicsLuid luid;
result = ovr_Create(&sess, &luid);
if (OVR_FAILURE(result)) {
ovrErrorInfo errorInfo;
ovr_GetLastErrorInfo(&errorInfo);
printf("ovr_Create failed: %d / %s", errorInfo.Result, errorInfo.ErrorString);
return 1;
}
ovrFovPort fov = { 0, 0, 0, 0 };
for (int eye = 0; eye < 2; eye++) {
ovrEyeRenderDesc desc = ovr_GetRenderDesc(sess, eye ? ovrEye_Right : ovrEye_Left, fov);
printf("Eye %d HmdToEyeOffset: %f, %f, %f\n", eye, desc.HmdToEyeOffset.x, desc.HmdToEyeOffset.y, desc.HmdToEyeOffset.z);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment