// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - OpenGL renderer" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_OPENGLRENDERER_OPENGLSWAPCHAIN_HPP #define NAZARA_OPENGLRENDERER_OPENGLSWAPCHAIN_HPP #include #include #include #include #include #include #include #include #include #include #include namespace Nz { class NAZARA_OPENGLRENDERER_API OpenGLSwapchain final : public Swapchain { public: OpenGLSwapchain(OpenGLDevice& device, WindowHandle windowHandle, const Vector2ui& windowSize, const SwapchainParameters& parameters); ~OpenGLSwapchain() = default; RenderFrame AcquireFrame() override; std::shared_ptr CreateCommandPool(QueueType queueType) override; inline GL::Context& GetContext(); const OpenGLFramebuffer& GetFramebuffer(std::size_t i) const override; std::size_t GetFramebufferCount() const override; const OpenGLRenderPass& GetRenderPass() const override; const Vector2ui& GetSize() const override; void NotifyResize(const Vector2ui& newSize) override; void Present(); private: std::optional m_renderPass; std::size_t m_currentFrame; std::vector> m_renderImage; std::shared_ptr m_context; OpenGLWindowFramebuffer m_framebuffer; Vector2ui m_size; bool m_sizeInvalidated; }; } #include #endif // NAZARA_OPENGLRENDERER_OPENGLSWAPCHAIN_HPP