Lugdunum  0.1.0
View.cpp
Go to the documentation of this file.
3 
4 namespace lug {
5 namespace Graphics {
6 namespace Render {
7 
8 View::View(const Target* renderTarget) : _renderTarget{renderTarget} {}
9 
10 void View::update() {
11  _viewport = {
12  { // offset
15  },
16 
17  { // extent
20  },
21 
22  _info.viewport.minDepth, // minDepth
23  _info.viewport.maxDepth // maxDepth
24  };
25 
26  _scissor = {
27  { // offset
30  },
31 
32  { // extent
35  }
36  };
37 
38  if (_camera) {
39  _camera->needUpdateProj();
40  }
41 }
42 
43 void View::init(View::InitInfo& initInfo) {
44  _info = std::move(initInfo);
45  _camera = std::move(_info.camera);
46 
47  update();
48 }
49 
50 } // Render
51 } // Graphics
52 } // lug
struct lug::Graphics::Render::View::Scissor::@2 offset
const Target * _renderTarget
Definition: View.hpp:90
View(const Target *renderTarget)
Definition: View.cpp:8
Resource::SharedPtr< Camera::Camera > camera
Definition: View.hpp:55
virtual uint16_t getHeight() const =0
struct lug::Graphics::Render::View::Scissor::@3 extent
struct lug::Graphics::Render::View::Viewport::@1 extent
struct lug::Graphics::Render::View::Viewport::@0 offset
void init(InitInfo &initInfo)
Definition: View.cpp:43
Resource::SharedPtr< Camera::Camera > _camera
Definition: View.hpp:96
virtual uint16_t getWidth() const =0