CRenderPass.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "ICamera.h"
5 #include "ILight.h"
6 #include "ISceneObject.h"
7 
8 
9 namespace ion
10 {
11  namespace Scene
12  {
13 
14  bool IsUniformNameArrayElement(string const & Label, int & Index, string & LHS, string & Remaining);
15 
17  {
18 
19  public:
20 
23 
24  virtual string const & GetName() const;
25  virtual CGraphicsAPI * GetGraphicsAPI();
27 
28  virtual ICamera * GetActiveCamera();
29  virtual ICamera const * GetActiveCamera() const;
30  virtual void SetActiveCamera(ICamera * Camera);
31 
32  virtual void AddLight(ILight * Light);
33  virtual void RemoveLight(ILight * Light);
34 
35  virtual void AddSceneObject(ISceneObject * SceneObject);
36  virtual void RemoveSceneObject(ISceneObject * SceneObject);
37 
38  virtual void SetUniform(string const & Name, SharedPointer<Graphics::IUniform> Uniform);
39  virtual void SetTexture(string const & Name, SharedPointer<Graphics::ITexture> Texture);
40 
41  virtual void Load();
42  virtual void Draw();
43  virtual void ReloadAll();
44 
46  virtual void SubmitPipelineStateForRendering(SharedPointer<Graphics::IPipelineState> PipelineState, ISceneObject * SceneObject, uint const InstanceCount = 1, uint const RenderCategory = 0);
47 
48  protected:
49 
50  ICamera * ActiveCamera = nullptr;
51  set<ISceneObject *> SceneObjects;
52  map<string, vector<ILight *>> Lights;
53 
54  map<string, SharedPointer<Graphics::IUniform>> Uniforms;
55  map<string, SharedPointer<Graphics::ITexture>> Textures;
56 
57  vector<vector<std::tuple<ISceneObject *, SharedPointer<Graphics::IPipelineState>, uint>>> RenderQueue;
58  string Name;
59 
63 
73 
74  };
75 
76  }
77 }
virtual string const & GetName() const
Definition: CRenderPass.cpp:20
set< ISceneObject * > SceneObjects
Definition: CRenderPass.h:51
virtual void SetActiveCamera(ICamera *Camera)
Definition: CRenderPass.cpp:45
Graphics::CUniform< vec3f > uCameraPosition
Definition: CRenderPass.h:68
Graphics::CUniform< glm::mat4 > uInvCameraMatrix
Definition: CRenderPass.h:72
CRenderPass(SharedPointer< Graphics::IGraphicsContext > GraphicsContext)
Definition: CRenderPass.cpp:10
Graphics::CUniform< glm::mat4 > uProjectionViewMatrix
Definition: CRenderPass.h:66
std::shared_ptr< T > SharedPointer
Definition: ionSmartPointer.h:22
virtual void RemoveLight(ILight *Light)
Definition: CRenderPass.cpp:56
Definition: ISceneObject.h:17
virtual void SetRenderTarget(SharedPointer< Graphics::IRenderTarget > RenderTarget)
Definition: CRenderPass.cpp:15
bool IsUniformNameArrayElement(string const &Label, int &Index, string &LHS, string &Remaining)
Definition: CRenderPass.cpp:153
virtual void Draw()
Definition: CRenderPass.cpp:95
map< string, vector< ILight * > > Lights
Definition: CRenderPass.h:52
Wraps a pointer to a singleton object.
Definition: ionClass.h:123
map< string, SharedPointer< Graphics::ITexture > > Textures
Definition: CRenderPass.h:55
unsigned int uint
Definition: ionTypes.h:99
map< string, SharedPointer< Graphics::IUniform > > Uniforms
Definition: CRenderPass.h:54
SingletonPointer< CGraphicsAPI > GraphicsAPI
Definition: CRenderPass.h:60
Graphics::CUniform< glm::mat4 > uInvProjectionViewMatrix
Definition: CRenderPass.h:67
Graphics::CUniform< glm::mat4 > uModelMatrix
Definition: CRenderPass.h:69
virtual void RemoveSceneObject(ISceneObject *SceneObject)
Definition: CRenderPass.cpp:67
ICamera * ActiveCamera
Definition: CRenderPass.h:50
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
virtual void SetUniform(string const &Name, SharedPointer< Graphics::IUniform > Uniform)
Definition: CRenderPass.cpp:72
virtual void AddLight(ILight *Light)
Definition: CRenderPass.cpp:50
Graphics::CUniform< glm::mat4 > uProjectionMatrix
Definition: CRenderPass.h:64
Definition: CRenderPass.h:16
virtual void SubmitPipelineStateForRendering(SharedPointer< Graphics::IPipelineState > PipelineState, ISceneObject *SceneObject, uint const InstanceCount=1, uint const RenderCategory=0)
Definition: CRenderPass.cpp:271
virtual void Load()
Definition: CRenderPass.cpp:84
Graphics::CUniform< glm::mat4 > uViewMatrix
Definition: CRenderPass.h:65
Graphics::CUniform< glm::mat4 > uNormalMatrix
Definition: CRenderPass.h:70
Graphics::CUniform< glm::mat4 > uCameraMatrix
Definition: CRenderPass.h:71
virtual void ReloadAll()
Definition: CRenderPass.cpp:145
virtual ICamera * GetActiveCamera()
Definition: CRenderPass.cpp:35
virtual void SetTexture(string const &Name, SharedPointer< Graphics::ITexture > Texture)
Definition: CRenderPass.cpp:78
string Name
Definition: CRenderPass.h:58
SharedPointer< Graphics::IGraphicsContext > GraphicsContext
Definition: CRenderPass.h:61
vector< vector< std::tuple< ISceneObject *, SharedPointer< Graphics::IPipelineState >, uint > > > RenderQueue
Definition: CRenderPass.h:57
virtual void AddSceneObject(ISceneObject *SceneObject)
Definition: CRenderPass.cpp:62
virtual SharedPointer< Graphics::IGraphicsContext > GetGraphicsContext()
Definition: CRenderPass.cpp:30
Definition: CGraphicsAPI.h:54
Definition: ICamera.h:12
virtual void PreparePipelineStateForRendering(SharedPointer< Graphics::IPipelineState > PipelineState, ISceneObject *SceneObject)
Definition: CRenderPass.cpp:170
virtual CGraphicsAPI * GetGraphicsAPI()
Definition: CRenderPass.cpp:25
Definition: ILight.h:13
SharedPointer< Graphics::IRenderTarget > RenderTarget
Definition: CRenderPass.h:62