Nebula
Loading...
Searching...
No Matches
view.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
12//------------------------------------------------------------------------------
13#include "core/refcounted.h"
14#include "frame/framescript.h"
15#include "timing/time.h"
16#include "graphicsentity.h"
17#include "stage.h"
18namespace Graphics
19{
20class Stage;
21class Camera;
22class View : public Core::RefCounted
23{
25public:
27 View();
29 virtual ~View();
30
32 void UpdateConstants();
34 void Render(const IndexT frameIndex, const Timing::Time time, const IndexT bufferIndex);
35
39 void BuildFrameScript();
40
45
47 void SetStage(const Ptr<Stage>& stage);
49 const Ptr<Stage>& GetStage() const;
50
52 bool IsEnabled() const;
53
55 void Enable();
56
58 void Disable();
59private:
60 friend class GraphicsServer;
61
65 bool enabled;
66};
67
68//------------------------------------------------------------------------------
71inline void
73{
74 this->camera = camera;
75}
76
77//------------------------------------------------------------------------------
80inline const GraphicsEntityId&
82{
83 return this->camera;
84}
85
86//------------------------------------------------------------------------------
89inline void
91{
92 this->stage = stage;
93}
94
95//------------------------------------------------------------------------------
98inline const Ptr<Stage>&
100{
101 return this->stage;
102}
103
104//------------------------------------------------------------------------------
107inline bool
109{
110 return this->enabled;
111}
112
113//------------------------------------------------------------------------------
116inline void
118{
119 this->enabled = true;
120}
121
122//------------------------------------------------------------------------------
125inline void
127{
128 this->enabled = false;
129}
130
131//------------------------------------------------------------------------------
134inline const Ptr<Frame::FrameScript>
136{
137 return this->script;
138}
139
140} // namespace Graphics
The common base class of Nebula.
Definition refcounted.h:38
The graphics server is the main singleton for the Graphics subsystem.
Definition graphicsserver.h:49
A view describes a camera which can observe a Stage.
Definition view.h:23
const GraphicsEntityId & GetCamera()
get camera
Definition view.h:81
bool IsEnabled() const
returns whether view is enabled
Definition view.h:108
virtual ~View()
destructor
Definition view.cc:35
Ptr< Frame::FrameScript > script
Definition view.h:62
GraphicsEntityId camera
Definition view.h:63
void SetStage(const Ptr< Stage > &stage)
set stage
Definition view.h:90
const Ptr< Frame::FrameScript > GetFrameScript() const
get frame script
Definition view.h:135
void BuildFrameScript()
Build frame script.
Definition view.cc:99
Ptr< Stage > stage
Definition view.h:64
const Ptr< Stage > & GetStage() const
get stage
Definition view.h:99
void Render(const IndexT frameIndex, const Timing::Time time, const IndexT bufferIndex)
render through view
Definition view.cc:85
void Disable()
disable this view
Definition view.h:126
bool enabled
Definition view.h:65
void SetCamera(const GraphicsEntityId &camera)
set camera
Definition view.h:72
void UpdateConstants()
Update constants.
Definition view.cc:44
void Enable()
enable this view
Definition view.h:117
View()
constructor
Definition view.cc:23
__DeclareClass(View)
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Implements the shader server used by Vulkan.
Definition cameramanager.h:21
double Time
the time datatype
Definition time.h:18
@ Camera
Definition visibility.h:39
The graphics entity is only an Id, to which we can attach GraphicsContexts.
Definition graphicsentity.h:16
Typedefs for the Timing subsystem.
int IndexT
Definition types.h:48