Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
stereoview.h
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
6 #include "view.h"
7 #include "etc/contextdependant.h"
8 
9 
10 class StereoViewEye;
11 class ScreenBlitter;
12 class StereoBlitProgram;
13 class ViewPort;
14 class StereoRenderInfo;
15 
16 class StereoView: public View, public ContextDependant {
17 public:
18  StereoView(const Viewport& viewport, const StereoRenderInfo& stereoRenderInfo);
19 
20  virtual void setViewport(const Viewport& viewport) override;
21 
22  virtual float fovy() const override;
23  virtual float zNear() const override;
24  virtual float aspectRatio() const override;
25 
26  virtual void draw(const Scene& scene, const CameraHead& cameraHead) override;
27 
28 
29 protected:
30  std::unique_ptr<StereoViewEye> m_leftEye;
31  std::unique_ptr<StereoViewEye> m_rightEye;
32  std::unique_ptr<ScreenBlitter> m_screenBlitter;
33  std::unique_ptr<StereoBlitProgram> m_stereoBlitProgram;
34 
35  glm::vec2 m_leftEyeLensCenter;
36  glm::vec2 m_rightEyeLensCenter;
37  std::vector<float> m_distortionKs;
38  float m_distortionScale;
39 
40  void initialize();
41 
42  virtual void beforeContextDestroy() override;
43  virtual void afterContextRebuild() override;
44 };
45 
Definition: camerahead.h:12
Definition: viewport.h:6
Definition: screenblitter.h:15
Definition: contextdependant.h:7
Definition: stereoblitprogram.h:8
Definition: stereoview.h:16
Definition: stereorenderinfo.h:14
Definition: stereovieweye.h:21
Definition: scene.h:14
Definition: view.h:9