#include <material_single_color.h>
Material for blin-phong lighting model class.
Definition at line 19 of file material_single_color.h.
◆ material_single_color() [1/4]
scl::material_single_color::material_single_color |
( |
| ) |
|
|
default |
Default material for blin-phong lighting model constructor.
◆ material_single_color() [2/4]
Default material data defautl copy constructor.
◆ material_single_color() [3/4]
scl::material_single_color::material_single_color |
( |
const vec3 & |
Color | ) |
|
|
inline |
- Material for blin-phong lighting model class contructor.
- Parameters
-
Definition at line 75 of file material_single_color.h.
75 :
77 {
78 Data.Color = Color;
80 }
static shared< constant_buffer > Create(u32 Size)
material(shared< shader_program > Shader)
static shared< shader_program > GetSingleColorMaterialShader()
◆ material_single_color() [4/4]
scl::material_single_color::material_single_color |
( |
shared< texture_2d > |
Texture | ) |
|
|
inline |
- Material for blin-phong lighting model class contructor.
- Parameters
-
Texture | - material texture. |
Definition at line 87 of file material_single_color.h.
87 :
89 {
90 this->Texture = Texture;
91 Data.IsTexture = true;
93 }
◆ Bind()
void scl::material_single_color::Bind |
( |
| ) |
const |
|
inlineoverridevirtual |
- Bind material to current render stage function.
- Parameters
-
- Returns
- None.
Reimplemented from scl::material.
Definition at line 101 of file material_single_color.h.
102 {
106 }
shared< shader_program > Shader
static const int BINDING_POINT_MATERIAL_DATA
static const int TEXTURE_SLOT_MATERIAL_DIFFUSE
◆ Create() [1/2]
- Material for blin-phong lighting model class contructor.
- Parameters
-
Definition at line 126 of file material_single_color.h.
127 {
128 return CreateShared<material_single_color>(Color);
129 }
◆ Create() [2/2]
- Material for blin-phong lighting model class contructor.
- Parameters
-
Texture | - material texture. |
Definition at line 136 of file material_single_color.h.
137 {
138 return CreateShared<material_single_color>(Texture);
139 }
◆ GetColor()
const vec3 & scl::material_single_color::GetColor |
( |
| ) |
const |
|
inline |
Material for blin-phong lighing model data getter setter functions.
Material color getter function.
Definition at line 34 of file material_single_color.h.
◆ GetIsTexture()
u32 scl::material_single_color::GetIsTexture |
( |
| ) |
const |
|
inline |
Material texture existance flag getter function.
Definition at line 36 of file material_single_color.h.
36{ return Data.IsTexture; }
◆ GetTexture()
◆ SetColor()
void scl::material_single_color::SetColor |
( |
const vec3 & |
Color | ) |
|
|
inline |
Color setter function.
Definition at line 41 of file material_single_color.h.
41 {
42 if (Texture)
43 {
44 Texture->Free();
45 Texture = nullptr;
46 }
47 Data.IsTexture = false;
48 Data.Color = Color;
49 DataBuffer->Update(&Data, sizeof(Data));
50 }
◆ SetTexture()
Texture setter function.
Definition at line 52 of file material_single_color.h.
52 {
53 if (!Texture) return;
54
55 if (this->Texture) this->Texture->Free();
56 this->Texture = Texture;
57 if (!Data.IsTexture)
58 {
59 Data.IsTexture = true;
60 DataBuffer->Update(&Data, sizeof(Data));
61 }
62 }
◆ Unbind()
void scl::material_single_color::Unbind |
( |
| ) |
const |
|
inlineoverridevirtual |
- Unbind material from current render stage function.
- Parameters
-
- Returns
- None.
Reimplemented from scl::material.
Definition at line 114 of file material_single_color.h.
115 {
117 if (DataBuffer) DataBuffer->Unbind();
118 if (Texture && Data.IsTexture) Texture->Unbind();
119 }
The documentation for this class was generated from the following file: