Make framebuffer clear color an engine config option
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -11,6 +18,7 @@ namespace openVulkanoCpp
|
||||
~EngineConfiguration() = default;
|
||||
|
||||
uint32_t numThreads = 1;
|
||||
std::array<float, 4> frameBufferClearColor = { 0.39f, 0.58f, 0.93f, 1.0f };
|
||||
|
||||
public:
|
||||
static EngineConfiguration* GetEngineConfiguration()
|
||||
@@ -28,5 +36,15 @@ namespace openVulkanoCpp
|
||||
{
|
||||
return std::max(static_cast<uint32_t>(1), numThreads);
|
||||
}
|
||||
|
||||
void SetFrameBufferClearColor(std::array<float, 4> frameBufferClearColor)
|
||||
{
|
||||
this->frameBufferClearColor = frameBufferClearColor;
|
||||
}
|
||||
|
||||
std::array<float, 4> GetFrameBufferClearColor() const
|
||||
{
|
||||
return frameBufferClearColor;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,15 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vulkan/vulkan.hpp>
|
||||
#include "Device.hpp"
|
||||
#include "FrameBuffer.hpp"
|
||||
#include "Base/EngineConfiguration.hpp"
|
||||
|
||||
namespace openVulkanoCpp
|
||||
{
|
||||
@@ -34,7 +42,7 @@ namespace openVulkanoCpp
|
||||
this->frameBuffer = frameBuffer;
|
||||
CreateRenderPass();
|
||||
frameBuffer->InitRenderPass(this);
|
||||
SetClearColor();
|
||||
SetClearColor(EngineConfiguration::GetEngineConfiguration()->GetFrameBufferClearColor());
|
||||
SetClearDepth();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user