Simple material class. Contains a diffuse color and an optional texture. Handles binding to the GPU pipeline.
More...
#include <Material.hpp>
|
| | Material ()=default |
| | Default constructor.
|
| | ~Material ()=default |
| | Destructor.
|
| bool | IsReady () const |
| | Checks if the material is ready to be used (texture loaded).
|
| void | Bind (ID3D11DeviceContext *context) const |
| | Binds the material to the GPU pipeline. If a texture is set and ready, it will be bound. Otherwise, a null shader resource view is bound.
|
|
| std::shared_ptr< TextureAsset > | texture = nullptr |
| | Texture associated with this material.
|
| DirectX::XMFLOAT3 | color = DirectX::XMFLOAT3(1.0f, 1.0f, 1.0f) |
| | Diffuse color of the material (RGB, 0..1).
|
Simple material class. Contains a diffuse color and an optional texture. Handles binding to the GPU pipeline.
◆ Material()
◆ ~Material()
◆ Bind()
| void Material::Bind |
( |
ID3D11DeviceContext * | context | ) |
const |
|
inline |
Binds the material to the GPU pipeline. If a texture is set and ready, it will be bound. Otherwise, a null shader resource view is bound.
- Parameters
-
| context | Device context used for binding |
◆ IsReady()
| bool Material::IsReady |
( |
| ) |
const |
|
inline |
Checks if the material is ready to be used (texture loaded).
- Returns
- True if texture exists and is ready, false otherwise
◆ color
| DirectX::XMFLOAT3 Material::color = DirectX::XMFLOAT3(1.0f, 1.0f, 1.0f) |
Diffuse color of the material (RGB, 0..1).
◆ texture
Texture associated with this material.
The documentation for this class was generated from the following file: