Refactor material system (#382)

This commit is contained in:
Jérôme Leclercq
2022-10-31 19:53:41 +01:00
committed by GitHub
parent 0a8048809c
commit dc6ce8427c
156 changed files with 3633 additions and 4569 deletions

View File

@@ -0,0 +1,43 @@
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_GRAPHICS_PROPERTYHANDLER_OPTIONVALUEPROPERTYHANDLER_HPP
#define NAZARA_GRAPHICS_PROPERTYHANDLER_OPTIONVALUEPROPERTYHANDLER_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Graphics/Config.hpp>
#include <Nazara/Graphics/PropertyHandler/PropertyHandler.hpp>
namespace Nz
{
class NAZARA_GRAPHICS_API OptionValuePropertyHandler : public PropertyHandler
{
public:
inline OptionValuePropertyHandler(std::string propertyName, std::string optionName);
OptionValuePropertyHandler(const OptionValuePropertyHandler&) = default;
OptionValuePropertyHandler(OptionValuePropertyHandler&&) = delete;
~OptionValuePropertyHandler() = default;
bool NeedsUpdateOnValueUpdate(std::size_t updatedPropertyIndex) const override;
void Setup(const Material& material, const ShaderReflection& reflection) override;
void Update(MaterialInstance& materialInstance) const override;
OptionValuePropertyHandler& operator=(const OptionValuePropertyHandler&) = delete;
OptionValuePropertyHandler& operator=(OptionValuePropertyHandler&&) = delete;
private:
std::size_t m_propertyIndex;
std::string m_propertyName;
std::string m_optionName;
UInt32 m_optionHash;
};
}
#include <Nazara/Graphics/PropertyHandler/OptionValuePropertyHandler.inl>
#endif // NAZARA_GRAPHICS_PROPERTYHANDLER_OPTIONVALUEPROPERTYHANDLER_HPP