Initial commit

This commit is contained in:
2026-09-27 01:33:35 +02:00
commit 3ac329a21b
1185 changed files with 543634 additions and 0 deletions

30
src/material.cpp Normal file
View File

@@ -0,0 +1,30 @@
#include "material.hpp"
namespace Fan
{
void Material::bind() const
{
shader->use();
// Diffuse (slot 0)
if (diffuse_map) {
diffuse_map->bind(0);
} else {
Texture::unbind(0);
}
shader->set_int("u_material.diffuse", 0);
// Specular (slot 1)
if (specular_map) {
specular_map->bind(1);
} else {
Texture::unbind(1);
}
shader->set_int("u_material.specular", 1);
// Shininess
shader->set_float("u_material.shininess", shininess);
}
} // namespace Fan