Skip to main content
Participant
September 13, 2017

Using Oculus SDK with existing initialized OpenGL context

I'm trying to build a plugin for the Rift with Autodesk's Motionbuilder. It has it's own encapsulated Rendering class so I just need to feed it FBOs and it'll render to them. The problem is I can't seem to initialize the Rift without it creating it's own independent window, rather than using the existing context set up by the host app Motionbuilder. So I think that when I try to bind the FBO, it's binding to the Rift window's context (I borrowed code from the Tiny Room project) and not actually handing its FBO to the host app's OpenGL instance (i.e. Motionbuilder).

I'm pretty new to OpenGL, but is this accurate and if so how can I get the Rift to work with the host OpenGL context instead of trying to set up its own?

    5 replies

    pixeratiAuthor
    Participant
    September 17, 2017
    Great, thanks.
    pixeratiAuthor
    Participant
    September 23, 2017
    Thanks. Yes, I found some of this on a couple of other forum posts. I think blitting is probably my best bet. Will try to incorporate in the next couple of days. Thanks for taking the time to follow up.


    pixeratiAuthor
    Participant
    September 25, 2017
    OK, so here's what's grinding me to a halt every time:

    the glGenFramebuffers function.

    This crashes without fail. From what I can tell, this is typically because glewInit() hasn't been called. But I can't call it, because OVR_CAPI_GL.h won't let me include it. Any ideas?
    pixeratiAuthor
    Participant
    September 25, 2017
    Seems the problem is that OVR_CAPI_GL.h is using an incompatible version of Glew...? Can I override this?
    pixeratiAuthor
    Participant
    September 30, 2017
    Found this in an old thread. Hard to believe this is still an issue from 2014, but I'm getting the same kind of exception with the glGenFrameBuffers crash. Does anyone on the Oculus team have a suggested workaround?

    https://forums.oculus.com/community/discussion/13903/opengl-0-4-2-please-stop