This website uses cookies. By clicking Accept, you consent to the use of cookies.
Click Here
to learn more about how we use cookies.
Accept
Reject
Browse
VR Forums
Announcements
Get Help
Talk VR
VR Experiences
International
Off-Topic
Developer Forums
Unity Development
Unreal Development
Meta Spatial SDK Development
Mobile Development
Web Development
OpenXR Development
General VR & MR Development
PCVR/Link Development
Quest Development
Accessibility Development
Developer Dashboard Feedback
SDK Development
Tool Feedback
Other VR Development
MVPs
Help
Sign In
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
Meta Community Forums
Developer
PCVR/Link
can't initializate rift, HELP
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Mute
Printer Friendly Page
can't initializate rift, HELP
SkiiNet
Explorer
Options
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
11-05-2016
09:06 AM
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);
}
c++
error
initialisation
All forum topics
Previous Topic
Next Topic
1 REPLY
1
Anonymous
Not applicable
Options
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
01-07-2017
12:29 PM
I 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.
Post Reply
Related Content
Achievements and Leaderboards with Unreal Engine 5.4.4
in
Unreal Development
2 weeks ago
When I build the project, the hands are not visible and I cannot interact with objects.
in
Unity Development
3 weeks ago
General vr development
in
General VR & MR Development
3 weeks ago
Suggestion for a New PCVR Headset on the Rift Platform
in
PCVR/Link Development
3 weeks ago
Screen blackout
in
Other VR Development
4 weeks ago