HatchitGraphics
ht_material.h
1 
25 #pragma once
26 
27 #include <ht_platform.h>
28 #include <ht_shader.h>
29 #include <ht_texture.h>
30 #include <ht_shadervariable.h>
31 #include <ht_math.h>
32 #include <ht_debug.h>
33 #include <ht_pipeline.h>
34 #include <ht_guid.h>
35 
36 #include <map>
37 
38 namespace Hatchit {
39 
40  namespace Core
41  {
42  template<typename VarType>
43  class Handle;
44  }
45 
46  namespace Resource
47  {
48  class Material;
49  }
50 
51  struct LayoutLocation {
52  uint32_t set;
53  uint32_t binding;
54  };
55 
56  namespace Graphics {
57 
58  class RenderPass;
59  class MaterialBase;
60 
61  class HT_API Material : public Core::RefCounted<Material>
62  {
63  public:
64  Material(Core::Guid ID);
65 
66  ~Material();
67 
68  bool Initialize(const std::string& file);
69  bool InitializeAsync(Core::Handle<Material> handle);
70 
71  bool SetInt(size_t chunk, size_t offset, int data);
72  bool SetFloat(size_t chunk, size_t offset, float data);
73  bool SetFloat3(size_t chunk, size_t offset, Math::Vector3 data);
74  bool SetFloat4(size_t chunk, size_t offset, Math::Vector4 data);
75  bool SetMatrix4(size_t chunk, size_t offset, Math::Matrix4 data);
76 
77  bool BindTexture(std::string name, TextureHandle texture);
78  bool UnbindTexture(std::string name, TextureHandle texture);
79 
80  bool Update();
81 
82  const std::vector<Core::Handle<RenderPass>>& GetRenderPasses() const;
83  PipelineHandle const GetPipeline() const;
84  MaterialBase* const GetBase() const;
85 
86  protected:
87  MaterialBase* m_base;
88 
89  };
90 
92  }
93 }
Definition: ht_material_base.h:51
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_color.h:19
Definition: ht_material.h:61
Definition: ht_material.h:51
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.