Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
wolftousen's avatar
wolftousen
Honored Guest
12 years ago

Problem with Direct HMD render OpenGL

I just got my rift the other day and wanted to get straight to playing around by converting some of my demos in C to work with it.

Instead of using the sdk source directly in my projects I found this: https://developer.oculusvr.com/forums/viewtopic.php?f=26&t=12331
You still have to compile the sdk to get the .lib to use with it.

I also followed this example to figure out exactly what needed to go on (seems far easier to read than the tuscany demo code): https://developer.oculusvr.com/forums/viewtopic.php?f=30&t=11068

My source is on github at: https://github.com/Wolftousen/OculusRiftTest

To get it working to this point I actually had to modify the CAPI_GL_Util.cpp file in the SDK to remove EXT from the end of some of the opengl function lookups (they were returning null for some reason with the EXT).

Everything compiles and runs without errors, I get the window on my desktop, but the issue is nothing ever displays on the Rift and i'm not sure why.

The tuscany and tiny room demo work fine as expected, but they are using directx, which i'm not all that familiar with. Would be nice to have opengl examples included in the SDK, but i digress.

The code on github is setup for x64, not win32 and it's using FreeGLUT.

I appreciate any help anyone can provide.

2 Replies

  • toi's avatar
    toi
    Honored Guest
    I believe they are aware of OpenGL issues. See viewtopic.php?f=34&t=12326&p=170309#p165885. I don't know if a fix has been released yet.
    I have tried to make a simple SDL2 sample myself and got it rendering with extended mode but there are issues with direct to rift. I have the same problem as you. Although I have not modified any of the SDK files.
    Before the v4.0.1 release my program failed to run at all. (I believe SDL2 failed to create a GL context)
    Let's hope further fixes will soon arrive; I am updating the download page several times a day to see any new releases.
  • Right, I managed to find that thread yesterday, thanks though. Glad i didn't spent a horrible amount of time on it.

    I only modified the SDK b/c it kept crashing on the end frame call. When it was calling wglGetProcAddress (somewhere in the sdk code) inside the SDK code it was trying to get the functions with the EXT at the end and it was getting null. I noticed that when it did this it was trying to retrieve the proc addresses from the ovr version (ovr dll or something) instead of the nvidia version (nv...dll) of the function. As soon as I removed the EXT it started picking up the nvidia function just fine and stopped crashing.

    The SDK was also trying to put the EXT version of the function into a non EXT version of the pointer type, which in the end shouldn't cause an issue since they have the same profile generall (or always), but was just troubling to see that.

    I know a few other people here have reported a similar issue, but i haven't seen a solution in my skimming. But if this gives anyone insights as to why direct mode doesn't work, kudos.