From de066231055c69b2010438f48231c599765d14f6 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Sat, 3 Aug 2024 19:16:46 +0200 Subject: [PATCH] Update texture sampler config handling --- openVulkanoCpp/Scene/Textrue.cpp | 5 +++-- openVulkanoCpp/Scene/Texture.hpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openVulkanoCpp/Scene/Textrue.cpp b/openVulkanoCpp/Scene/Textrue.cpp index 8f74300..389e328 100644 --- a/openVulkanoCpp/Scene/Textrue.cpp +++ b/openVulkanoCpp/Scene/Textrue.cpp @@ -8,7 +8,7 @@ namespace OpenVulkano::Scene { - Texture Texture::PLACEHOLDER = Texture(SamplerConfig::DEFAULT, true); + Texture Texture::PLACEHOLDER = Texture(&SamplerConfig::NEAREST, true); void Texture::MakePlaceholder(uint32_t width, uint32_t height, Math::Vector4uc color1, Math::Vector4uc color2) { @@ -25,5 +25,6 @@ namespace OpenVulkano::Scene resolution = {width, height, 1}; size = sizeof(Math::Vector4uc) * width * height; format = DataFormat::B8G8R8A8_UNORM; + m_samplerConfig = &SamplerConfig::NEAREST; } -} \ No newline at end of file +} diff --git a/openVulkanoCpp/Scene/Texture.hpp b/openVulkanoCpp/Scene/Texture.hpp index 41b854d..e65a1ce 100644 --- a/openVulkanoCpp/Scene/Texture.hpp +++ b/openVulkanoCpp/Scene/Texture.hpp @@ -34,10 +34,10 @@ namespace OpenVulkano::Scene Math::Vector3ui resolution = {0,0,0}; DataFormat format = DataFormat::B8G8R8A8_UNORM; UpdateFrequency updateFrequency = UpdateFrequency::Never; - const SamplerConfig& m_samplerConfig; + const SamplerConfig* m_samplerConfig; bool updated = true; - Texture(const SamplerConfig& samplerConfig = SamplerConfig::DEFAULT, bool placeholder = false) + Texture(const SamplerConfig* samplerConfig = &SamplerConfig::DEFAULT, bool placeholder = false) : m_samplerConfig(samplerConfig) { if (placeholder) MakePlaceholder(); }