Simulant  21.12-1292
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
material_object.h
1 #pragma once
2 
3 #include "../../types.h"
4 #include "constants.h"
5 #include "core/material_property_overrider.h"
6 
7 namespace smlt {
8 
9 class MaterialPropertyRegistry;
10 class MaterialPropertyValue;
11 
13 public:
14  friend class Material;
15 
17  MaterialPropertyOverrider(nullptr) {}
18 
20  virtual ~MaterialObject();
21 
22  /* Built-in properties */
23  void set_specular(const Color& color);
24  void set_ambient(const Color& color);
25  void set_diffuse(const Color& color);
26  void set_emission(const Color& color);
27  void set_shininess(float shininess);
28  void set_diffuse_map(TexturePtr texture);
29  void set_light_map(TexturePtr texture);
30  void set_specular_map(TexturePtr texture);
31  void set_normal_map(TexturePtr texture);
32 
33  const Mat4& diffuse_map_matrix() const;
34  const Mat4& light_map_matrix() const;
35  const Mat4& normal_map_matrix() const;
36  const Mat4& specular_map_matrix() const;
37 
38  void set_diffuse_map_matrix(const Mat4& mat);
39  void set_light_map_matrix(const Mat4& mat);
40  void set_normal_map_matrix(const Mat4& mat);
41  void set_specular_map_matrix(const Mat4& mat);
42 
43  const TexturePtr& diffuse_map() const;
44  const TexturePtr& light_map() const;
45  const TexturePtr& normal_map() const;
46  const TexturePtr& specular_map() const;
47 
48  void set_fog_density(float density);
49  void set_fog_start(float start);
50  void set_fog_end(float end);
51  void set_fog_mode(FogMode mode);
52  void set_fog_color(const Color& color);
53 
54  float fog_density() const;
55  float fog_start() const;
56  float fog_end() const;
57  FogMode fog_mode() const;
58  const Color& fog_color() const;
59 
60  const Color& specular() const;
61  const Color& ambient() const;
62  const Color& emission() const;
63  const Color& diffuse() const;
64  float shininess() const;
65  bool is_blending_enabled() const;
66  void set_blend_func(BlendType b);
67  BlendType blend_func() const;
68 
69  void set_depth_func(DepthFunc b);
70  DepthFunc depth_func() const;
71  void set_depth_write_enabled(bool v);
72  bool is_depth_write_enabled() const;
73 
74  void set_alpha_func(AlphaFunc a);
75  AlphaFunc alpha_func() const;
76  void set_alpha_threshold(float v);
77  float alpha_threshold() const;
78  bool is_alpha_testing_enabled() const;
79 
80  void set_cull_mode(CullMode mode);
81  CullMode cull_mode() const;
82  void set_depth_test_enabled(bool v);
83  bool is_depth_test_enabled() const;
84  void set_lighting_enabled(bool v);
85  bool is_lighting_enabled() const;
86  void set_textures_enabled(EnabledTextureMask v);
87  int32_t textures_enabled() const;
88  float point_size() const;
89 
90  void set_polygon_mode(PolygonMode mode);
91  PolygonMode polygon_mode() const;
92 
93  void set_shade_model(ShadeModel model);
94  ShadeModel shade_model() const;
95 
96  ColorMaterial color_material() const;
97  void set_color_material(ColorMaterial cm);
98 
99  const MaterialObject* parent_material_object() const {
100  return dynamic_cast<const MaterialObject*>(this->parent_);
101  }
102 
103 };
104 
105 }
106 
smlt::Mat4
Definition: mat4.h:35
smlt::Material
Definition: material.h:199
smlt
Definition: animation.cpp:25
smlt::Color
Definition: color.h:32
smlt::MaterialObject
Definition: material_object.h:12
smlt::MaterialPropertyOverrider
Definition: material_property_overrider.h:23