X-Git-Url: http://git.tdb.fi/?p=libs%2Fvr.git;a=blobdiff_plain;f=source%2Flibovr%2Flibovrcombiner.h;fp=source%2Flibovr%2Flibovrcombiner.h;h=789de552e50ff15b73abc5658b4c96a4d7ba7b61;hp=0000000000000000000000000000000000000000;hb=31c28161d36749d040cbab0099b352f53cad232d;hpb=b6de7d24475dec8f5d6b8148a69cf8b561bc0761 diff --git a/source/libovr/libovrcombiner.h b/source/libovr/libovrcombiner.h new file mode 100644 index 0000000..789de55 --- /dev/null +++ b/source/libovr/libovrcombiner.h @@ -0,0 +1,42 @@ +#ifndef MSP_VR_LIBOVRCOMBINER_H_ +#define MSP_VR_LIBOVRCOMBINER_H_ + +#include +#include +#include +#include +#include + +namespace Msp { +namespace VR { + +class LibOVRSystem; + +/** +Presents a stereo view in a way suitable for an Oculus Rift HMD. All distances +are specified in multiples of the screen width. +*/ +class LibOVRCombiner: public StereoCombiner +{ +private: + struct Frustum; + + LibOVRSystem &device; + GL::View &view; + GL::Mesh left_mesh; + GL::Mesh right_mesh; + GL::Program shprog; + mutable GL::ProgramData left_shdata; + mutable GL::ProgramData right_shdata; + +public: + LibOVRCombiner(LibOVRSystem &, GL::View &); + + virtual void prepare() const; + virtual void render(const GL::Texture2D &, const GL::Texture2D &) const; +}; + +} // namespace VR +} // namespace Msp + +#endif