#pragma once #include #include namespace lt::renderer { class ISwapchain { public: [[nodiscard]] static auto create( Api target_api, class ISurface *surface, class IGpu *gpu, class IDevice *device ) -> memory::Scope; ISwapchain() = default; virtual ~ISwapchain() = default; ISwapchain(ISwapchain &&) = default; ISwapchain(const ISwapchain &) = delete; auto operator=(ISwapchain &&) -> ISwapchain & = default; auto operator=(const ISwapchain &) -> ISwapchain & = delete; }; } // namespace lt::renderer #include #include namespace lt::renderer { [[nodiscard]] /* static */ auto ISwapchain::create( Api target_api, ISurface *surface, IGpu *gpu, IDevice *device ) -> memory::Scope { switch (target_api) { case Api::vulkan: return memory::create_scope(surface, gpu, device); case Api::none: case Api::metal: case Api::direct_x: throw std::runtime_error { "Invalid API" }; } } } // namespace lt::renderer