--- /dev/null
+#ifndef MSP_GL_OCULUSRIFTCOMBINER_H_
+#define MSP_GL_OCULUSRIFTCOMBINER_H_
+
+#include "mesh.h"
+#include "program.h"
+#include "programdata.h"
+#include "stereocombiner.h"
+
+namespace Msp {
+namespace GL {
+
+/**
+Presents a stereo view in a way suitable for an Oculus Rift HMD. All distances
+are specified in multiples of the screen width.
+*/
+class OculusRiftCombiner: public StereoCombiner
+{
+private:
+ Mesh mesh;
+ Program shprog;
+ ProgramData left_shdata;
+ ProgramData right_shdata;
+ float view_distance;
+ float lens_separation;
+ float eye_separation;
+ float distortion[4];
+ float fill_factor;
+
+public:
+ OculusRiftCombiner();
+
+ void set_view_distance(float);
+ void set_lens_separation(float);
+ void set_eye_separation(float);
+ void set_distortion(float = 1.0f, float = 0.0f, float = 0.0f, float = 0.0f);
+ void set_fill_factor(float);
+private:
+ void update_parameters();
+
+ float distort(float) const;
+ float undistort(float) const;
+
+public:
+ virtual void render(const Texture2D &, const Texture2D &) const;
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif