| 489 | } |
| 490 | |
| 491 | void Buffer::update() { |
| 492 | const auto stage = game_object_ref().get_stage(); |
| 493 | if (!stage.has_value()) { |
| 494 | return; |
| 495 | } |
| 496 | const auto cam_obj = stage->get().get_game_object("camera"); |
| 497 | if (!cam_obj.has_value()) { |
| 498 | return; |
| 499 | } |
| 500 | const auto camera_opt = |
| 501 | cam_obj->get().get_component<Camera>("camera_component"); |
| 502 | if (!camera_opt.has_value()) { |
| 503 | return; |
| 504 | } |
| 505 | const auto& camera = camera_opt->get(); |
| 506 | const auto zoom = camera.compute_zoom(); |
| 507 | |
| 508 | buff_prog_.use(); |
| 509 | if (zoom > BufferConstants::ZOOM_BORDER_THRESHOLD) { |
| 510 | buff_prog_.uniform1i("enable_borders", 1); |
| 511 | } else { |
| 512 | buff_prog_.uniform1i("enable_borders", 0); |
| 513 | } |
| 514 | |
| 515 | update_object_pose(); |
| 516 | } |
| 517 | |
| 518 | void Buffer::update_object_pose() const { |
| 519 | const auto rotation = mat4::rotation(angle_); |
nothing calls this directly
no test coverage detected