/* * 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 "UpdateFrequency.hpp" #include "Base/ICloseable.hpp" #include "Math/Math.hpp" #include "DataFormat.hpp" #include "Scene/Shader/DescriptorInputDescription.hpp" namespace OpenVulkano::Scene { class Texture { public: static Texture PLACEHOLDER; static constexpr inline DescriptorSetLayoutBinding DESCRIPTOR_SET_LAYOUT_BINDING = { 0, DescriptorSetLayoutBinding::Type::TYPE_COMBINED_IMAGE_SAMPLER, 1, ShaderProgramType::ALL_GRAPHICS }; Texture(bool placeholder = false) { if (placeholder) MakePlaceholder(); } ICloseable* renderTexture = nullptr; void* textureBuffer = nullptr; Math::Vector3ui resolution = {0,0,0}; size_t size = 0; DataFormat format = DataFormat::B8G8R8A8_UNORM; bool updated = true; UpdateFrequency updateFrequency = UpdateFrequency::Never; void MakePlaceholder(uint32_t width = 32, uint32_t height = 32, Math::Vector4uc color1 = {255, 135, 255, 255}, Math::Vector4uc color2 = {255, 225, 255, 255}); }; }