Add logic to allow lazy rendering
This commit is contained in:
@@ -17,9 +17,10 @@ namespace OpenVulkano
|
||||
{
|
||||
namespace
|
||||
{
|
||||
const char *NUM_THREADS_STR = "num_threads";
|
||||
const char *FRAMEBUFFER_CLEAR_COLOR_STR = "framebuffer_clear_color";
|
||||
const char *PREFER_FRAMEBUFFER_FORMAT_SRGB_STR = "prefer_framebuffer_format_srgb";
|
||||
const char* NUM_THREADS_STR = "NumThreads";
|
||||
const char* FRAMEBUFFER_CLEAR_COLOR_STR = "FramebufferClearColor";
|
||||
const char* PREFER_FRAMEBUFFER_FORMAT_SRGB_STR = "PreferFramebufferFormatSRGB";
|
||||
const char* LAZY_RENDERING_STR = "LazyRendering";
|
||||
}
|
||||
|
||||
EngineConfiguration::EngineConfiguration()
|
||||
@@ -50,6 +51,11 @@ namespace OpenVulkano
|
||||
{
|
||||
root[PREFER_FRAMEBUFFER_FORMAT_SRGB_STR] >> m_preferFramebufferFormatSRGB;
|
||||
}
|
||||
|
||||
if (root.has_child(LAZY_RENDERING_STR))
|
||||
{
|
||||
root[LAZY_RENDERING_STR] >> m_lazyRendering;
|
||||
}
|
||||
}
|
||||
|
||||
EngineConfiguration* EngineConfiguration::GetEngineConfiguration()
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace OpenVulkano
|
||||
uint32_t m_numThreads = 1;
|
||||
std::array<float, 4> m_frameBufferClearColor = { 0.39f, 0.58f, 0.93f, 1.0f };
|
||||
bool m_preferFramebufferFormatSRGB = true;
|
||||
bool m_lazyRendering = false;
|
||||
|
||||
public:
|
||||
[[nodiscard]] static EngineConfiguration* GetEngineConfiguration();
|
||||
@@ -32,7 +33,10 @@ namespace OpenVulkano
|
||||
void SetFrameBufferClearColor(std::array<float, 4> frameBufferClearColor) { m_frameBufferClearColor = frameBufferClearColor; }
|
||||
[[nodiscard]] const std::array<float, 4>& GetFrameBufferClearColor() const { return m_frameBufferClearColor; }
|
||||
|
||||
[[nodiscard]] bool GetPreferFramebufferFormatSRGB() const {return m_preferFramebufferFormatSRGB; }
|
||||
[[nodiscard]] bool GetPreferFramebufferFormatSRGB() const { return m_preferFramebufferFormatSRGB; }
|
||||
void SetPreferFramebufferFormatSRGB(bool sRGB) { m_preferFramebufferFormatSRGB = sRGB; }
|
||||
|
||||
[[nodiscard]] bool GetLazyRendering() const { return m_lazyRendering; }
|
||||
void SetLazyRendering(bool lazyRender) { m_lazyRendering = lazyRender; }
|
||||
};
|
||||
}
|
||||
@@ -15,6 +15,7 @@ namespace OpenVulkano
|
||||
public:
|
||||
uint64_t frameId = 0;
|
||||
double frameTime = 1;
|
||||
bool shouldDraw = true;
|
||||
|
||||
FrameMetadata() = default;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user