#pragma once #include "rhi.h" #include "renderer_backend.h" #include #include namespace Donut { struct CameraView { glm::mat4 view; glm::mat4 projection; glm::vec3 position; int fb_width = 1; int fb_height = 1; }; class SceneRenderer { public: auto init(RHI::Device& device) -> bool; auto render(RHI::CommandList& cmd, const CameraView& cam, const std::vector& objects, int selected, RHI::Texture* cubemap) -> void; private: static constexpr int MAX_OBJECTS = 64; RHI::Device* m_device = nullptr; Ref m_grid_pipeline; Ref m_grid_vb; Ref m_grid_ubo; int m_grid_vertex_count = 0; Ref m_sphere_pipeline; Ref m_sphere_vb; Ref m_sphere_ib; int m_sphere_index_count = 0; std::vector> m_sphere_ubos; Ref m_skybox_pipeline; Ref m_skybox_vb; Ref m_skybox_ubo; }; }