#pragma once #include "assets/data/texture.hpp" #include "assets/data/uniform_surface_properties.hpp" #include "assets/components/material_components.hpp" #include "opengl/handles/material_handle.hpp" #include "opengl/data/texture_data.hpp" #include namespace zgl { struct material_data { private: material_data( const std::optional& texture_handle, const std::optional& surface_properties_handle, const std::optional& alpha_handle, std::optional&& texture_data, material_components::flags components ); public: material_data() = default; [[nodiscard]] static std::error_code build_from( const std::optional& texture_opt, const std::optional& surface_properties_opt, const std::optional& transparency_opt, material_component::flags components, material_data& data ); material_data(const material_data& other) = delete; material_data& operator=(const material_data& other) = delete; material_data(material_data&& other) noexcept; material_data& operator=(material_data&& other) noexcept; [[nodiscard]] material_handle handle() const; [[nodiscard]] material_component::flags components() const; private: material_handle m_handle{}; std::optional m_texture_data{ std::nullopt }; material_component::flags m_component_types{ material_component::flags::none }; }; } #define INCLUDE_MATERIAL_DATA_IMPLEMENTATION #include "opengl/data/material_data.ipp" #undef INCLUDE_MATERIAL_DATA_IMPLEMENTATION