feat: add lights

This commit is contained in:
2025-10-14 11:45:46 +02:00
parent c34d3f803f
commit 50a4f56e75
14 changed files with 355 additions and 10 deletions

View File

@@ -73,6 +73,14 @@ void Shader::setup_attribs() const
loc, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
reinterpret_cast<const void*>(offsetof(Vertex, tex_coord)));
}
loc = glGetAttribLocation(program_id_, "vnormal");
if (loc != -1) {
glEnableVertexAttribArray(loc);
glVertexAttribPointer(
loc, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex),
reinterpret_cast<const void*>(offsetof(Vertex, normal)));
}
}
int Shader::uniform_location(const char* key) const