1 #ifndef RAYLIB_CPP_INCLUDE_MATERIAL_HPP_
2 #define RAYLIB_CPP_INCLUDE_MATERIAL_HPP_
7 #include "./raylib.hpp"
8 #include "./raylib-cpp-utils.hpp"
16 Material(const ::Material& material) {
24 set(LoadMaterialDefault());
43 static std::vector<Material>
Load(
const std::string& fileName) {
46 ::Material* materials = ::LoadMaterials(fileName.c_str(), &count);
47 return std::vector<Material>(materials, materials + count);
51 GETTERSETTER(::MaterialMap*, Maps, maps)
80 if (maps !=
nullptr) {
81 ::UnloadMaterial(*
this);
90 ::SetMaterialTexture(
this, mapType, texture);
106 ::DrawMeshInstanced(mesh, *
this, transforms, instances);
111 void set(const ::Material& material) {
112 shader = material.shader;
113 maps = material.maps;
114 params[0] = material.params[0];
115 params[1] = material.params[1];
116 params[2] = material.params[2];
117 params[3] = material.params[3];
const Material & DrawMesh(const ::Mesh &mesh, ::Matrix *transforms, int instances) const
Draw multiple mesh instances with material and different transforms.
Material & SetTexture(int mapType, const ::Texture2D &texture)
Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...)
const Material & DrawMesh(const ::Mesh &mesh, ::Matrix transform) const
Draw a 3d mesh with material and transform.
void Unload()
Unload material from memory.
Material()
Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
static std::vector< Material > Load(const std::string &fileName)
Load materials from model file.
Matrix type (OpenGL style 4x4 - right handed, column major)
All raylib-cpp classes and functions appear in the raylib namespace.