/* * 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 #include #include #undef max namespace OpenVulkano { class EngineConfiguration { private: EngineConfiguration(); ~EngineConfiguration() = default; uint32_t m_numThreads = 1; std::array m_frameBufferClearColor = { 0.39f, 0.58f, 0.93f, 1.0f }; bool m_preferFramebufferFormatSRGB = true; public: [[nodiscard]] static EngineConfiguration* GetEngineConfiguration(); void SetNumThreads(uint32_t numThreads) { m_numThreads = numThreads; } [[nodiscard]] uint32_t GetNumThreads() const { return std::max(static_cast(1), m_numThreads); } void SetFrameBufferClearColor(std::array frameBufferClearColor) { m_frameBufferClearColor = frameBufferClearColor; } [[nodiscard]] const std::array& GetFrameBufferClearColor() const { return m_frameBufferClearColor; } [[nodiscard]] bool GetPreferFramebufferFormatSRGB() const {return m_preferFramebufferFormatSRGB; } void SetPreferFramebufferFormatSRGB(bool sRGB) { m_preferFramebufferFormatSRGB = sRGB; } }; }