62 lines
1.4 KiB
C++
62 lines
1.4 KiB
C++
/*
|
|
* 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>
|
|
#undef max
|
|
|
|
namespace OpenVulkano
|
|
{
|
|
class EngineConfiguration
|
|
{
|
|
private:
|
|
EngineConfiguration() = default;
|
|
~EngineConfiguration() = default;
|
|
|
|
uint32_t numThreads = 1;
|
|
std::array<float, 4> frameBufferClearColor = { 0.39f, 0.58f, 0.93f, 1.0f };
|
|
bool preferFramebufferFormatSRGB = true;
|
|
|
|
public:
|
|
[[nodiscard]] static EngineConfiguration* GetEngineConfiguration()
|
|
{
|
|
static EngineConfiguration* config = new EngineConfiguration();
|
|
return config;
|
|
}
|
|
|
|
void SetNumThreads(uint32_t numThreads)
|
|
{
|
|
this->numThreads = numThreads;
|
|
}
|
|
|
|
[[nodiscard]] uint32_t GetNumThreads() const
|
|
{
|
|
return std::max(static_cast<uint32_t>(1), numThreads);
|
|
}
|
|
|
|
void SetFrameBufferClearColor(std::array<float, 4> frameBufferClearColor)
|
|
{
|
|
this->frameBufferClearColor = frameBufferClearColor;
|
|
}
|
|
|
|
[[nodiscard]] const std::array<float, 4>& GetFrameBufferClearColor() const
|
|
{
|
|
return frameBufferClearColor;
|
|
}
|
|
|
|
[[nodiscard]] bool GetPreferFramebufferFormatSRGB() const
|
|
{
|
|
return preferFramebufferFormatSRGB;
|
|
}
|
|
|
|
void SetPreferFramebufferFormatSRGB(bool sRGB)
|
|
{
|
|
preferFramebufferFormatSRGB = sRGB;
|
|
}
|
|
};
|
|
} |