Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
marky1124's avatar
marky1124
Explorer
13 years ago

Visual Studio and OpenGL

Hi,

I'm interested in whether I can build a Rift project on Windows in Visual Studio using OpenGL. I'm hoping someone has already figured out some of this stuff. Can anyone tell me whether it's possible to do this using the SDK Oculus gives us?

Looking at the Windows and Linux SDK packages I can see that the Samples/CommonSrc files are identical. Am I right that the Windows SDK uses DirectX and the Linux SDK uses OpenGL?

Has anyone converted the samples to run on Windows using OpenGL?

Cheers,
Mark

3 Replies

  • The SDK doesn't manage the graphics engine, just allows you to interface with the HMD and the sensor. You're free to build an application in OpenGL and use the information read from the SDK to position the cameras.

    In order to perform the distortion required for rendering you need a multi pass approach. You first do two normal renders to custom contexts to basically create the entire scene as a texture (or rather two textures, one for each eye). You then do a second pass rendering the texture(s) to the actual framebuffer using a specialized fragment shader to provide the appropriate distortion.

    There are a couple of other threads on the forum dealing with writing a simple OpenGL application for the Rift. Take a look around and see if one has the information you need.
  • In the latest SDK, in Samples/CommonSrc/ there are some files Render_GL_Win32_Device.cpp/h.

    I don't have Windows/VS, and haven't looked at these files, but I'm guessing someone did this as part of the process of developing the Linux/OpenGL version of the samples -- if so, they should be workable.
  • Thank you for your replies (sorry it's taken me so long to respond).