Graphics/RenderSystem: Add support for external swapchains
This commit is contained in:
@@ -2,11 +2,23 @@
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <type_traits>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline void RenderSystem::AttachExternalSwapchain(WindowSwapchain& swapchain)
|
||||
{
|
||||
m_windowSwapchains.emplace_back(&swapchain);
|
||||
}
|
||||
|
||||
inline void RenderSystem::DetachExternalSwapchain(WindowSwapchain& swapchain)
|
||||
{
|
||||
auto it = std::find_if(m_externalSwapchains.begin(), m_externalSwapchains.end(), [&](WindowSwapchain& externalSwapchain) { return &externalSwapchain == &swapchain; });
|
||||
NazaraAssert(it != m_externalSwapchains.end(), "external swapchain is not part of this render system");
|
||||
m_externalSwapchains.erase(it);
|
||||
}
|
||||
|
||||
inline FramePipeline& RenderSystem::GetFramePipeline()
|
||||
{
|
||||
return *m_pipeline;
|
||||
@@ -19,3 +31,4 @@ namespace Nz
|
||||
}
|
||||
|
||||
#include <Nazara/Graphics/DebugOff.hpp>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user