Files
OpenVulkano/openVulkanoCpp/Scene/DataFormat.cpp
2021-01-21 21:15:19 +01:00

23 lines
582 B
C++

/*
* 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/.
*/
#include "DataFormat.hpp"
#include <magic_enum.hpp>
namespace openVulkanoCpp
{
std::string_view DataFormat::GetName() const
{
return magic_enum::enum_name(m_format);
}
DataFormat DataFormat::GetFromName(std::string_view name)
{
auto result = magic_enum::enum_cast<Format>(name);
if (result.has_value()) return { result.value() };
return { UNDEFINED };
}
}