Пример #1
0
int main(int argc, char *argv[]) {



    EVRInitError error;
    VR_InitInternal(&error, EVRApplicationType_VRApplication_Scene);
    printf("Init error: %s\n", VR_GetVRInitErrorAsEnglishDescription(error));


    char fnTableName[128];
    int result = sprintf(fnTableName, "FnTable:%s", IVRSystem_Version);

    EVRInitError initError;
    struct VR_IVRSystem_FnTable *fnTable;
    fnTable = (struct VR_IVRSystem_FnTable*)VR_GetGenericInterface(fnTableName, &initError);

    printf("%s\n", fnTable->GetEventTypeNameFromEnum(EVREventType_VREvent_TrackedDeviceActivated));
    printf("Init error: %s\n", VR_GetVRInitErrorAsEnglishDescription(initError));

    HmdMatrix44_t matrix = fnTable->GetProjectionMatrix(
        EVREye_Eye_Left, 0.1, 10000, EGraphicsAPIConvention_API_OpenGL);

    // HmdMatrix44_t matrix = VR_IVRSystem_GetProjectionMatrix(sys,
    //     Hmd_Eye_Eye_Left, 0.1, 10000, GraphicsAPIConvention_API_OpenGL);
    printf("%f\n", matrix.m[0][0]);


    return 0;
}
Пример #2
0
OVR_PUBLIC_FUNCTION(void) ovr_GetLastErrorInfo(ovrErrorInfo* errorInfo)
{
	if (!errorInfo)
		return;

	const char* error = VR_GetVRInitErrorAsEnglishDescription(g_InitError);
	strncpy_s(errorInfo->ErrorString, error, sizeof(ovrErrorInfo::ErrorString));
	errorInfo->Result = REV_InitErrorToOvrError(g_InitError);
}