Forum Discussion

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

Cross-platform example code for Oculus Rift in Action

I've written a number of examples for the book that I'm co-authoring on software development for the Rift. They use CMake for project generation, and OpenGL for rendering, relying on GLFW and GLEW for OpenGL management across platforms.

You can clone the repository and all it's submodules with the command

git clone https://github.com/jherico/OculusRiftInAction.git --recursive


The recursive flag is important, because the project depends on the submodules being in place.

You can build a project file for the examples using CMake. I recommend doing an out of source build.


cd OculusRiftInAction
mkdir build
cd build
cmake .. [-g <your preferred generator>]


On most platforms if you don't specify a CMake generator it will default to the most common detected generator for that platform, such as Visual Studio for Windows, or XCode for OSX.

Once you've run the CMake command you should be able to open the project folder up in your OculusRiftInAction/build directory and then build and run the examples.

I think right now the chapter 5 examples are the most interesting, as they demonstrate a variety of ways to approach the distortion mechanism, using pre-rendered images so that the examples can focus solely on the distortion mechanism alone, rather than rendering a scene and distortion.

Feedback on any issues with the example code or suggestions for stuff you feel might be covered better is very welcome. You can reply to this thread or open issues on the Github repository.
No RepliesBe the first to reply