gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
material.h
1 // © Joseph Cameron - All Rights Reserved
2 
3 #ifndef GDK_GFX_MATERIAL_H
4 #define GDK_GFX_MATERIAL_H
5 
6 #include <string>
7 #include <memory>
8 
9 #include <gdk/graphics_types.h>
10 
11 namespace gdk
12 {
13  class texture;
14 
20  class material
21  {
22  public:
24  enum class FaceCullingMode
25  {
26  Front,
27  Back,
28  FrontAndBack,
29  None
30  };
31 
33  enum class render_mode
34  {
35  opaque,
36  transparent
37  };
38 
40  using texture_ptr_type = std::shared_ptr<gdk::texture>;
41 
44  virtual void setTexture(const std::string &aName, texture_ptr_type aTexturePointer) = 0;
45 
47  virtual void setFloat(const std::string& aName, float aValue) = 0;
48 
50  virtual void setVector2(const std::string &aName, graphics_vector2_type aValue) = 0;
51 
53  virtual void setVector3(const std::string &aName, graphics_vector3_type aValue) = 0;
54 
56  virtual void setVector4(const std::string &aName, graphics_vector4_type aValue) = 0;
57 
59  virtual void setInteger(const std::string& aName, int aValue) = 0;
60 
62  virtual void setInteger2(const std::string& aName, int aValue1, int aValue2) = 0;
63 
65  virtual void setInteger3(const std::string& aName, int aValue1, int aValue2,
66  int aValue3) = 0;
67 
69  virtual void setInteger4(const std::string& aName, int aValue1, int aValue2,
70  int aValue3, int aValue4) = 0;
71 
72  virtual ~material() = default;
73  };
74 }
75 
76 #endif
77 
Definition: camera.h:9
virtual void setInteger2(const std::string &aName, int aValue1, int aValue2)=0
assigns a 2 integer array to the material.
virtual void setVector3(const std::string &aName, graphics_vector3_type aValue)=0
assigns a 3 component vector
cull front and back facing polygons
do not cull any polygons
cull front facing polygons
std::shared_ptr< gdk::texture > texture_ptr_type
textures can be shared among many webgl1es2_materials.
Definition: material.h:40
decides how models using the material should be drawn.
Definition: material.h:20
render_mode
render mode decides transparency etc
Definition: material.h:33
virtual void setVector4(const std::string &aName, graphics_vector4_type aValue)=0
assigns a 4 component vector
cull back facing polygons
FaceCullingMode
specify whether front- or back-facing polygons can be culled
Definition: material.h:24
virtual void setInteger3(const std::string &aName, int aValue1, int aValue2, int aValue3)=0
assigns a 3 integer array to the material.
virtual void setVector2(const std::string &aName, graphics_vector2_type aValue)=0
assigns a 2 component vector
virtual void setInteger(const std::string &aName, int aValue)=0
assigns an integer to the material.
virtual void setInteger4(const std::string &aName, int aValue1, int aValue2, int aValue3, int aValue4)=0
assigns a 4 integer array to the material.
virtual void setTexture(const std::string &aName, texture_ptr_type aTexturePointer)=0
assigns a texture to the material.
virtual void setFloat(const std::string &aName, float aValue)=0
assigns a float to the material.