CSimpleSceneObject.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "ISceneObject.h"
5 #include "CSimpleMesh.h"
6 
7 
8 namespace ion
9 {
10  namespace Scene
11  {
12 
14  {
15 
16  public:
17 
19 
20  virtual void Load(CRenderPass * RenderPass);
21  virtual void Draw(CRenderPass * RenderPass);
22 
24  virtual void SetVertexBuffer(uint const Index, SharedPointer<Graphics::IVertexBuffer> VertexBuffer);
26  virtual void SetTexture(string const & Name, SharedPointer<Graphics::ITexture> Texture);
27  virtual void SetUniform(string const & Name, SharedPointer<Graphics::IUniform> Uniform);
28  virtual void SetFeatureEnabled(Graphics::EDrawFeature const Feature, bool const Enabled);
29  virtual void SetPolygonOffsetAmount(float const Amount);
30  virtual void SetBlendMode(Graphics::EBlendMode const BlendMode);
32  virtual void SetRenderCategory(uint const Category);
33  virtual void SetInstanceCount(uint const InstanceCount);
34 
35  template <typename T>
36  void SetUniformValue(string const & Name, T const & Value)
37  {
38  SetUniform(Name, Graphics::CUniform<T>(Value));
39  }
40 
41  virtual SSimpleMaterial & GetMaterial();
42  virtual SSimpleMaterial const & GetMaterial() const;
43  virtual void SetMaterial(SSimpleMaterial const & Material);
44 
45  protected:
46 
47  map<CRenderPass *, SharedPointer<Graphics::IPipelineState>> PipelineStates;
49 
51  vector<SharedPointer<Graphics::IVertexBuffer>> VertexBuffers;
53 
54  map<string, SharedPointer<Graphics::ITexture>> Textures;
55  map<string, SharedPointer<Graphics::IUniform>> Uniforms;
56  map<Graphics::EDrawFeature, bool> DrawFeatures;
57  float PolygonOffsetAmount = 1.f;
61  uint InstanceCount = 1;
62 
63  };
64 
65  }
66 }
virtual void SetVertexBuffer(uint const Index, SharedPointer< Graphics::IVertexBuffer > VertexBuffer)
Definition: CSimpleSceneObject.cpp:84
virtual void SetUniform(string const &Name, SharedPointer< Graphics::IUniform > Uniform)
Definition: CSimpleSceneObject.cpp:113
virtual void SetMaterial(SSimpleMaterial const &Material)
Definition: CSimpleSceneObject.cpp:186
EBlendMode
Definition: IPipelineState.h:30
uint RenderCategory
Definition: CSimpleSceneObject.h:60
Definition: CSimpleMesh.h:14
Definition: ISceneObject.h:17
virtual void SetPolygonOffsetAmount(float const Amount)
Definition: CSimpleSceneObject.cpp:136
virtual void SetPrimitiveType(Graphics::EPrimitiveType const PrimitiveType)
Definition: CSimpleSceneObject.cpp:156
virtual void SetIndexBuffer(SharedPointer< Graphics::IIndexBuffer > IndexBuffer)
Definition: CSimpleSceneObject.cpp:78
map< Graphics::EDrawFeature, bool > DrawFeatures
Definition: CSimpleSceneObject.h:56
Definition: CSimpleSceneObject.h:13
vector< SharedPointer< Graphics::IVertexBuffer > > VertexBuffers
Definition: CSimpleSceneObject.h:51
virtual void Load(CRenderPass *RenderPass)
Definition: CSimpleSceneObject.cpp:14
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
SSimpleMaterial Material
Definition: CSimpleSceneObject.h:52
SharedPointer< Graphics::IShader > Shader
Definition: CSimpleSceneObject.h:48
unsigned int uint
Definition: ionTypes.h:42
map< string, SharedPointer< Graphics::IUniform > > Uniforms
Definition: CSimpleSceneObject.h:55
virtual void SetTexture(string const &Name, SharedPointer< Graphics::ITexture > Texture)
Definition: CSimpleSceneObject.cpp:100
Graphics::EPrimitiveType PrimitiveType
Definition: CSimpleSceneObject.h:59
virtual void SetRenderCategory(uint const Category)
Definition: CSimpleSceneObject.cpp:166
Helper class to easily add a uniform as a member or local variable.
Definition: IUniform.h:158
EDrawFeature
Definition: IPipelineState.h:19
virtual void SetShader(SharedPointer< Graphics::IShader > Shader)
Definition: CSimpleSceneObject.cpp:94
Graphics::EBlendMode BlendMode
Definition: CSimpleSceneObject.h:58
Definition: CRenderPass.h:16
void SetUniformValue(string const &Name, T const &Value)
Definition: CSimpleSceneObject.h:36
float PolygonOffsetAmount
Definition: CSimpleSceneObject.h:57
virtual void Draw(CRenderPass *RenderPass)
Definition: CSimpleSceneObject.cpp:69
EPrimitiveType
Definition: IPipelineState.h:40
~CSimpleSceneObject()
Definition: CSimpleSceneObject.cpp:11
virtual void SetFeatureEnabled(Graphics::EDrawFeature const Feature, bool const Enabled)
Definition: CSimpleSceneObject.cpp:126
SharedPointer< Graphics::IIndexBuffer > IndexBuffer
Definition: CSimpleSceneObject.h:50
virtual void SetBlendMode(Graphics::EBlendMode const BlendMode)
Definition: CSimpleSceneObject.cpp:146
uint InstanceCount
Definition: CSimpleSceneObject.h:61
virtual void SetInstanceCount(uint const InstanceCount)
Definition: CSimpleSceneObject.cpp:171
map< string, SharedPointer< Graphics::ITexture > > Textures
Definition: CSimpleSceneObject.h:54
std::shared_ptr< T > SharedPointer
Definition: ionSmartPointer.h:25
virtual SSimpleMaterial & GetMaterial()
Definition: CSimpleSceneObject.cpp:176
map< CRenderPass *, SharedPointer< Graphics::IPipelineState > > PipelineStates
Definition: CSimpleSceneObject.h:47