raylib-cpp
C++ object-oriented wrapper library for raylib.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
raylib::Material Class Reference

Material type (generic) More...

#include <Material.hpp>

Public Member Functions

 Material ()
 Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) More...
 
 Material (const ::Material &material)
 
 Material (const Material &)=delete
 
 Material (Material &&other)
 
void DrawMesh (const ::Mesh &mesh, ::Matrix *transforms, int instances) const
 Draw multiple mesh instances with material and different transforms. More...
 
void DrawMesh (const ::Mesh &mesh, ::Matrix transform) const
 Draw a 3d mesh with material and transform. More...
 
void DrawMesh (const ::Mesh &mesh, std::span<::Matrix > transforms) const
 Draw multiple mesh instances with material and different transforms. More...
 
::MaterialMap * GetMaps () const
 Retrieves the maps value for the object. More...
 
::Shader GetShader () const
 Retrieves the shader value for the object. More...
 
bool IsReady () const
 Check if material is ready. More...
 
Materialoperator= (const ::Material &material)
 
Materialoperator= (const Material &)=delete
 
Materialoperator= (Material &&other) noexcept
 
void SetMaps (::MaterialMap *value)
 Sets the maps value for the object. More...
 
void SetShader (::Shader value)
 Sets the shader value for the object. More...
 
MaterialSetTexture (int mapType, const ::Texture2D &texture)
 Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) More...
 
void Unload ()
 Unload material from memory. More...
 

Static Public Member Functions

static std::vector< MaterialLoad (const std::string_view fileName)
 Load materials from model file. More...
 

Protected Member Functions

void set (const ::Material &material)
 

Detailed Description

Material type (generic)

Definition at line 16 of file Material.hpp.

Constructor & Destructor Documentation

◆ Material() [1/3]

raylib::Material::Material ( const ::Material &  material)
inline

Definition at line 18 of file Material.hpp.

◆ Material() [2/3]

raylib::Material::Material ( )
inline

Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)

Definition at line 25 of file Material.hpp.

Referenced by Load().

◆ Material() [3/3]

raylib::Material::Material ( Material &&  other)
inline

Definition at line 31 of file Material.hpp.

◆ ~Material()

raylib::Material::~Material ( )
inline

Definition at line 42 of file Material.hpp.

Member Function Documentation

◆ DrawMesh() [1/3]

void raylib::Material::DrawMesh ( const ::Mesh &  mesh,
::Matrix *  transforms,
int  instances 
) const
inline

Draw multiple mesh instances with material and different transforms.

Definition at line 110 of file Material.hpp.

◆ DrawMesh() [2/3]

void raylib::Material::DrawMesh ( const ::Mesh &  mesh,
::Matrix  transform 
) const
inline

Draw a 3d mesh with material and transform.

Definition at line 103 of file Material.hpp.

References DrawMesh().

Referenced by DrawMesh().

◆ DrawMesh() [3/3]

void raylib::Material::DrawMesh ( const ::Mesh &  mesh,
std::span<::Matrix >  transforms 
) const
inline

Draw multiple mesh instances with material and different transforms.

Definition at line 117 of file Material.hpp.

◆ GetMaps()

::MaterialMap * raylib::Material::GetMaps ( ) const
inline

Retrieves the maps value for the object.

Returns
The maps value of the object.

Definition at line 57 of file Material.hpp.

◆ GetShader()

::Shader raylib::Material::GetShader ( ) const
inline

Retrieves the shader value for the object.

Returns
The shader value of the object.

Definition at line 56 of file Material.hpp.

◆ IsReady()

bool raylib::Material::IsReady ( ) const
inline

Check if material is ready.

Definition at line 124 of file Material.hpp.

◆ Load()

static std::vector< Material > raylib::Material::Load ( const std::string_view  fileName)
inlinestatic

Load materials from model file.

Definition at line 49 of file Material.hpp.

References Material().

◆ operator=() [1/2]

Material & raylib::Material::operator= ( const ::Material &  material)
inline

Definition at line 61 of file Material.hpp.

◆ operator=() [2/2]

Material & raylib::Material::operator= ( Material &&  other)
inlinenoexcept

Definition at line 68 of file Material.hpp.

◆ set()

void raylib::Material::set ( const ::Material &  material)
inlineprotected

Definition at line 129 of file Material.hpp.

◆ SetMaps()

void raylib::Material::SetMaps ( ::MaterialMap *  value)
inline

Sets the maps value for the object.

Parameters
valueThe value of which to set maps to.

Definition at line 57 of file Material.hpp.

◆ SetShader()

void raylib::Material::SetShader ( ::Shader  value)
inline

Sets the shader value for the object.

Parameters
valueThe value of which to set shader to.

Definition at line 56 of file Material.hpp.

◆ SetTexture()

Material & raylib::Material::SetTexture ( int  mapType,
const ::Texture2D &  texture 
)
inline

Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...)

Definition at line 95 of file Material.hpp.

◆ Unload()

void raylib::Material::Unload ( )
inline

Unload material from memory.

Definition at line 85 of file Material.hpp.