Implement the red windows.

This commit is contained in:
Zed A. Shaw 2026-08-30 13:17:35 -04:00
parent 11b7f4a3ed
commit f51df89054
18 changed files with 74 additions and 36 deletions

View file

@ -7,6 +7,15 @@ void Scene::update() {
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
// for now just detect the camera moved and do spotlight update
if(camera.dirty) {
light.camera.position = camera.position;
light.camera.direction = camera.front;
// just update the camera's light
shader.apply_spot_light(light.camera, 0);
camera.dirty = false;
}
camera.update(deltaTime);
}
@ -38,15 +47,6 @@ void Scene::render(GLFWwindow* window) {
shader.setMat4("view", view);
shader.setMat4("projection", projection);
// for now just detect the camera moved and do spotlight update
if(camera.dirty) {
light.camera.position = camera.position;
light.camera.direction = camera.front;
// just update the camera's light
shader.apply_spot_light(light.camera, 0);
camera.dirty = false;
}
for(auto& thing : things) {
draw_thing(shader, thing);
}