#pragma once #include #include #include namespace lt::renderer::vk { using memory::NullOnMove; /** A layer of glue between main graphics objects. */ class Context: public IContext { public: Context(const ecs::Entity &surface_entity); [[nodiscard]] auto instance() const -> IInstance * override { return m_instance; } [[nodiscard]] auto gpu() const -> IGpu * override { return m_gpu.get(); } [[nodiscard]] auto device() const -> IDevice * override { return m_device.get(); } [[nodiscard]] auto swapchain() const -> ISwapchain * override { return m_swapchain.get(); } [[nodiscard]] auto surface() const -> ISurface * override { return m_surface.get(); } void recreate_swapchain() override { m_swapchain.reset(); // m_swapchain = create_scope(m_device, m_surface); } private: IInstance *m_instance; Scope m_surface; Scope m_gpu; Scope m_device; Scope m_swapchain; }; } // namespace lt::renderer::vk