A simple Mac OS X OpenGL VR environment with the barrel warp shader, including Oculus SDK (DK1 generation) integration. For DK2, OculusVR formally supports a sample SDK+Xcode project.
Also useful as a skeleton VR environment for other (non-Oculus) VR HMDs
- keyboard:
F
full screen+
-
change virtual interpupillary distance△
▽
◁
▷
walk around - mouse: click to activate mouse look
NOTE THIS IS ALREADY DONE. you don’t have to do any of this, these are notes for how I built this project from scratch- in case you want to do it yourself.
Drag LibOVR into Xcode Project, uncheck all “Add to Target”
Link libovr.a (drag it from LibOVR/Lib/MacOS/Debug), and IOKit
Set architecture to 64-bit Intel (x86_64)
C++ settings- set the standard library to libstdc++ (GNU C++ standard library), disable exceptions, disable runtime types
Coordinate your Search Paths to wherever the LibOVR folder resides: Header Search Paths (same for debug and release): LibOVR/Src, LibOVR/Include Library Search Paths:
- Debug : LibOVR/Lib/MacOS/Debug
- Release : LibOVR/Lib/MacOS/Release
Any classes which include OVR.h, and the classes which include THOSE classes, must be named *.mm, or must be marked as Objective-C++ source. Leave the .h files alone.
For reference: this is the example’s directory structure
edit
main.mm
:
#import <Cocoa/Cocoa.h>
#include "OVR.h”
using namespace OVR;
int main(int argc, const char * argv[])
{
System::Init();
return NSApplicationMain(argc, argv);
}
If this builds, success!