HatchitGraphics
ht_material_base.h
1 
15 #pragma once
16 
17 
18 #include <ht_platform.h>
19 #include <ht_string.h>
20 #include <ht_math.h>
21 #include <ht_shadervariable.h>
22 #include <ht_shadervariablechunk.h>
23 #include <ht_texture.h>
24 #include <ht_pipeline.h>
25 #include <ht_refcounted.h>
26 #include <map>
27 
28 namespace Hatchit {
29 
30  namespace Core
31  {
32  template<typename VarType>
33  class Handle;
34  }
35 
36  namespace Resource
37  {
38  class Material;
39  }
40 
41  namespace Graphics {
42 
43 
44  struct LayoutLocation {
45  uint32_t set;
46  uint32_t binding;
47  };
48 
49  class RenderPass;
50 
51  class HT_API MaterialBase
52  {
53  public:
54  MaterialBase();
55  ~MaterialBase();
56 
57  bool SetInt(size_t chunk, size_t offset, int data);
58  bool SetFloat(size_t chunk, size_t offset, float data);
59  bool SetFloat3(size_t chunk, size_t offset, Math::Vector3 data);
60  bool SetFloat4(size_t chunk, size_t offset, Math::Vector4 data);
61  bool SetMatrix4(size_t chunk, size_t offset, Math::Matrix4 data);
62 
63  virtual bool VBindTexture(std::string name, TextureHandle texture) = 0;
64  virtual bool VUnbindTexture(std::string name, TextureHandle texture) = 0;
65 
66  virtual bool VUpdate() = 0;
67 
68  virtual PipelineHandle const VGetPipeline() const = 0;
69 
70  protected:
71  std::vector<Core::Handle<RenderPass>> m_renderPasses;
72 
73  std::vector<LayoutLocation> m_shaderVariableLocations;
74  std::vector<ShaderVariableChunk*> m_shaderVariables;
75 
76  friend class Material;
77  };
78  }
79 }
Definition: ht_renderpass.h:41
Definition: ht_material_base.h:51
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_color.h:19
Definition: ht_material_base.h:44
Definition: ht_material.h:61