Lugdunum  0.1.0
View.inl
Go to the documentation of this file.
1 inline View::InitInfo& View::getInfo() {
2  return _info;
3 }
4 
5 inline const View::InitInfo& View::getInfo() const {
6  return _info;
7 }
8 
9 inline const View::Viewport& View::getViewport() const {
10  return _viewport;
11 }
12 
13 inline const View::Scissor& View::getScissor() const {
14  return _scissor;
15 }
16 
17 inline const Math::Vec3f& View::getClearColor() const {
18  return _clearColor;
19 }
20 
21 inline void View::setClearColor(const Math::Vec3f& color) {
22  _clearColor = color;
23 }
24 
25 inline void View::attachCamera(Resource::SharedPtr<Camera::Camera> camera) {
26  if (!camera) {
27  _camera = nullptr;
28  return;
29  }
30 
31  if (_camera) {
32  _camera->setRenderView(nullptr);
33  }
34 
35  _camera = std::move(camera);
36  _camera->setRenderView(this);
37 }
38 
39 inline Resource::SharedPtr<Camera::Camera> View::getCamera() const {
40  return _camera;
41 }
42 
43 
44 inline float View::Viewport::getRatio() const {
45  return extent.width / extent.height;
46 }
Dummy class for a shared pointer.
Definition: Resource.hpp:66