Created
April 12, 2016 01:54
-
-
Save comex/6768751e27b89aa8b1b08b654af2d39e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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