sculpto
Main Page
Namespaces
Classes
Files
File List
File Members
core
resources
materials
material.h
Go to the documentation of this file.
1
/*!****************************************************************/
/*!*
2
* \file material.h
3
* \brief Mesh material class deinition module.
4
*
5
* \author Sabitov Kirill
6
* \date 01 July 2022
7
*********************************************************************/
8
9
#pragma once
10
11
#include "
core/render/primitives/shader.h
"
12
#include "
core/render/render_context.h
"
13
14
namespace
scl
15
{
17
class
material
18
{
19
public
:
20
shared<shader_program>
Shader
{};
21
22
/*!*
23
* Material constructor by shader only.
24
*
25
* \param Shader - material shader to use while mesh with this material rendering.
26
*/
27
material
(
shared<shader_program>
Shader
) :
28
Shader
(
Shader
) {}
29
30
/*!*
31
* Bind material to current render stage function.
32
*
33
* \param None.
34
* \return None.
35
*/
36
virtual
void
Bind
()
const
37
{
38
if
(
Shader
!=
nullptr
)
Shader
->Bind();
39
}
40
41
/*!*
42
* Unbind material from current render stage function.
43
*
44
* \param Slot - texture slot to unbind it from.
45
* \return None.
46
*/
47
virtual
void
Unbind
()
const
48
{
49
if
(
Shader
!=
nullptr
)
Shader
->Unbind();
50
}
51
52
/*!*
53
* Material creation function by shader only.
54
*
55
* \param Shader - material shader to use while mesh with this material rendering.
56
*/
57
static
shared<material>
Create
(
shared<shader_program>
Shader
)
58
{
59
return
CreateShared<material>(
Shader
);
60
}
61
};
62
}
scl::material
Definition:
material.h:18
scl::material::Unbind
virtual void Unbind() const
Definition:
material.h:47
scl::material::Create
static shared< material > Create(shared< shader_program > Shader)
Definition:
material.h:57
scl::material::Bind
virtual void Bind() const
Definition:
material.h:36
scl::material::material
material(shared< shader_program > Shader)
Definition:
material.h:27
scl::material::Shader
shared< shader_program > Shader
Definition:
material.h:20
scl
Definition:
base.h:33
scl::shared
std::shared_ptr< T > shared
Definition:
smart_ptr.h:15
render_context.h
Base, abstract, backend render api independent render context class implementation module.
shader.h
Shader program interface definition module.
Generated by
1.9.4