CPipelineState.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionCore.h>
5 #include <ionMath.h>
6 #include <ionGraphics.h>
7 
8 #include "CShaderProgram.h"
9 #include "CVertexBuffer.h"
10 #include "CIndexBuffer.h"
11 
12 
13 namespace ion
14 {
15  namespace Graphics
16  {
17  namespace GL
18  {
19 
21  {
22 
23  public:
24 
27 
29  void SetVertexBuffer(uint const Index, SharedPointer<IVertexBuffer> VertexBuffer);
31  void SetUniform(string const & Name, SharedPointer<IUniform> Uniform);
32  void SetTexture(string const & Name, SharedPointer<ITexture> Texture);
33 
35  void SetFeatureEnabled(EDrawFeature const Feature, bool const Enabled);
36  void SetPolygonOffsetAmount(float const Amount);
37  void SetBlendMode(EBlendMode const BlendMode);
38 
39  void OfferUniform(string const & Name, SharedPointer<IUniform> Uniform);
40  void OfferTexture(string const & Name, SharedPointer<ITexture> Texture);
41 
42  void IgnoreUniform(string const & Name);
43 
44  set<string> GetUnboundUniforms() const;
45 
46  void Load();
47 
48  CWindow * Window = nullptr;
49 
51  vector<SharedPointer<CVertexBuffer>> VertexBuffers;
53 
55  bool Loaded = false;
56 
57  map<string, SharedPointer<IUniform const>> Uniforms;
58  map<uint, SharedPointer<IUniform const>> BoundUniforms;
59 
60  map<string, SharedPointer<ITexture const>> Textures;
61  map<u32, SharedPointer<ITexture const>> BoundTextures;
62 
63  set<string> UnboundUniforms;
64  set<string> UnboundAttributes;
65 
66  bool DrawWireframe = false;
67  bool CullFront = false;
68  bool CullBack = false;
69  bool DisableDepthTest = false;
70  bool DisableDepthWrite = false;
71  bool PolygonOffset = false;
72  float PolygonOffsetAmount = 1.f;
75 
76  };
77 
78  }
79  }
80 }
void SetFeatureEnabled(EDrawFeature const Feature, bool const Enabled)
Definition: CPipelineState.cpp:163
SharedPointer< CShaderProgram > ShaderProgram
Definition: CPipelineState.h:50
bool CullBack
Definition: CPipelineState.h:68
uint PrimitiveType
Definition: CPipelineState.h:74
void SetIndexBuffer(SharedPointer< IIndexBuffer > IndexBuffer)
Definition: CPipelineState.cpp:64
void SetPolygonOffsetAmount(float const Amount)
Definition: CPipelineState.cpp:188
EBlendMode
Definition: IPipelineState.h:30
std::shared_ptr< T > SharedPointer
Definition: ionSmartPointer.h:22
bool Loaded
Definition: CPipelineState.h:55
bool PolygonOffset
Definition: CPipelineState.h:71
map< u32, SharedPointer< ITexture const > > BoundTextures
Definition: CPipelineState.h:61
unsigned int uint
Definition: ionTypes.h:99
void SetProgram(SharedPointer< IShaderProgram > ShaderProgram)
Definition: CPipelineState.cpp:23
bool DisableDepthWrite
Definition: CPipelineState.h:70
void OfferTexture(string const &Name, SharedPointer< ITexture > Texture)
Definition: CPipelineState.cpp:219
vector< SharedPointer< CVertexBuffer > > VertexBuffers
Definition: CPipelineState.h:51
float PolygonOffsetAmount
Definition: CPipelineState.h:72
void IgnoreUniform(string const &Name)
Definition: CPipelineState.cpp:240
bool CullFront
Definition: CPipelineState.h:67
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
void Load()
Definition: CPipelineState.cpp:250
set< string > UnboundAttributes
Definition: CPipelineState.h:64
bool DisableDepthTest
Definition: CPipelineState.h:69
Definition: IPipelineState.h:47
Definition: CWindow.h:17
bool DrawWireframe
Definition: CPipelineState.h:66
CWindow * Window
Definition: CPipelineState.h:48
EDrawFeature
Definition: IPipelineState.h:19
void OfferUniform(string const &Name, SharedPointer< IUniform > Uniform)
Definition: CPipelineState.cpp:198
CPipelineState(CWindow *Window)
Definition: CPipelineState.cpp:13
void SetVertexBuffer(uint const Index, SharedPointer< IVertexBuffer > VertexBuffer)
Definition: CPipelineState.cpp:51
set< string > GetUnboundUniforms() const
Definition: CPipelineState.cpp:245
EPrimitiveType
Definition: IPipelineState.h:38
void SetTexture(string const &Name, SharedPointer< ITexture > Texture)
Definition: CPipelineState.cpp:106
SharedPointer< CIndexBuffer > IndexBuffer
Definition: CPipelineState.h:52
EBlendMode BlendMode
Definition: CPipelineState.h:73
map< uint, SharedPointer< IUniform const > > BoundUniforms
Definition: CPipelineState.h:58
Definition: CPipelineState.h:20
map< string, SharedPointer< ITexture const > > Textures
Definition: CPipelineState.h:60
set< string > UnboundUniforms
Definition: CPipelineState.h:63
map< string, SharedPointer< IUniform const > > Uniforms
Definition: CPipelineState.h:57
uint VertexArrayHandle
Definition: CPipelineState.h:54
void SetBlendMode(EBlendMode const BlendMode)
Definition: CPipelineState.cpp:193
void SetUniform(string const &Name, SharedPointer< IUniform > Uniform)
Definition: CPipelineState.cpp:73
~CPipelineState()
Definition: CPipelineState.cpp:19
void SetPrimitiveType(EPrimitiveType const PrimitiveType)
Definition: CPipelineState.cpp:143