Forum Discussion
SkiiNet
9 years agoExplorer
can't initializate rift, HELP
Hello guys! I am having errors trying to initialize the rift in a C++
program, for some reason it doesn't initialize and I don't know why
here is my code:
//include standard libraries
#include <iostream>
using namespace std;
//include GL
#include <GL\glew.h>
//include Oculus
#include <oculus/include/OVR_CAPI_GL.h>
//declare all ovr variables
#if !defined(OVR_OS_WIN32) && defined(_WIN32)
#define OVR_OS_WIN32
#endif
#ifndef VALIDATE
#define VALIDATE(x, msg) if (!(x)) { MessageBoxA(NULL, (msg), "UTRGV Simulation", MB_ICONERROR | MB_OK); exit(-1); }
#endif
#ifndef OVR_DEBUG_LOG
#define OVR_DEBUG_LOG(x)
#endif
void ovrInit();
ovrInitParams initParams = { ovrInit_RequestVersion, OVR_MINOR_VERSION, NULL, 0, 0 };
ovrSession session;
ovrGraphicsLuid luid;
int main() {
//oculus initialization
//see ovrInit()
ovrInit();
}
//this method get output from the oculus
void ovrInit() {
//step 1 initialize te oculus
ovr_Initialize(&initParams);//
if (!ovr_Initialize(&initParams)) {
cout << "Error Initializing the oculus!" << endl;
}
else {
cout << "Oculus is running!\n" << endl;
cout << OVR_MINOR_VERSION << endl;
cout << OVR_MAJOR_VERSION << endl;
}
ovrHmdDesc hmdDesc = ovr_GetHmdDesc(session);
}
program, for some reason it doesn't initialize and I don't know why
here is my code:
//include standard libraries
#include <iostream>
using namespace std;
//include GL
#include <GL\glew.h>
//include Oculus
#include <oculus/include/OVR_CAPI_GL.h>
//declare all ovr variables
#if !defined(OVR_OS_WIN32) && defined(_WIN32)
#define OVR_OS_WIN32
#endif
#ifndef VALIDATE
#define VALIDATE(x, msg) if (!(x)) { MessageBoxA(NULL, (msg), "UTRGV Simulation", MB_ICONERROR | MB_OK); exit(-1); }
#endif
#ifndef OVR_DEBUG_LOG
#define OVR_DEBUG_LOG(x)
#endif
void ovrInit();
ovrInitParams initParams = { ovrInit_RequestVersion, OVR_MINOR_VERSION, NULL, 0, 0 };
ovrSession session;
ovrGraphicsLuid luid;
int main() {
//oculus initialization
//see ovrInit()
ovrInit();
}
//this method get output from the oculus
void ovrInit() {
//step 1 initialize te oculus
ovr_Initialize(&initParams);//
if (!ovr_Initialize(&initParams)) {
cout << "Error Initializing the oculus!" << endl;
}
else {
cout << "Oculus is running!\n" << endl;
cout << OVR_MINOR_VERSION << endl;
cout << OVR_MAJOR_VERSION << endl;
}
ovrHmdDesc hmdDesc = ovr_GetHmdDesc(session);
}
1 Reply
- AnonymousI don't use the open GL libraries. But DX version work like this
ovrSession session;
ovrGraphicsLuid luid;
ovrResult check = ovr_Initialize(nullptr);
// error check omitted
check = ovr_Create(&session, &luid)));
// error check omitted
hope that helps.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 2 months ago
- 2 years ago
- 1 year ago