sculpto
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
13
14namespace scl
15{
18 {
19 public:
21
22 /*!*
23 * Material constructor by shader only.
24 *
25 * \param Shader - material shader to use while mesh with this material rendering.
26 */
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 */
58 {
59 return CreateShared<material>(Shader);
60 }
61 };
62}
virtual void Unbind() const
Definition: material.h:47
static shared< material > Create(shared< shader_program > Shader)
Definition: material.h:57
virtual void Bind() const
Definition: material.h:36
material(shared< shader_program > Shader)
Definition: material.h:27
shared< shader_program > Shader
Definition: material.h:20
Definition: base.h:33
std::shared_ptr< T > shared
Definition: smart_ptr.h:15
Base, abstract, backend render api independent render context class implementation module.
Shader program interface definition module.