diff --git a/openVulkanoCpp/Scene/AtlasData.hpp b/openVulkanoCpp/Scene/AtlasData.hpp index 2fc74ef..1c75272 100644 --- a/openVulkanoCpp/Scene/AtlasData.hpp +++ b/openVulkanoCpp/Scene/AtlasData.hpp @@ -10,6 +10,7 @@ #include "Math/Math.hpp" #include "Image/Image.hpp" #include "Scene/Texture.hpp" +#include "Scene/Text/FontAtlasType.hpp" #include #include #include @@ -25,36 +26,6 @@ namespace OpenVulkano::Scene double advance = 0; }; - class FontAtlasType - { - public: - enum Type : int16_t - { - SDF = 0, - MSDF, - BITMAP, - UNKNOWN - }; - - static constexpr std::string_view DEFAULT_FG_SHADERS[] = { "Shader/sdfText", "Shader/msdfText", "Shader/text" }; - - constexpr FontAtlasType(Type type) : m_type(type) {} - - [[nodiscard]] constexpr Type GetType() const { return m_type; } - - [[nodiscard]] constexpr auto GetName() const { return magic_enum::enum_name(m_type); } - - [[nodiscard]] constexpr const std::string_view& GetDefaultFragmentShader() const - { - return DEFAULT_FG_SHADERS[static_cast(m_type)]; - } - - [[nodiscard]] constexpr operator Type() const { return m_type; } - - private: - Type m_type; - }; - struct AtlasMetadata { // vertical difference between baselines diff --git a/openVulkanoCpp/Scene/Text/FontAtlasType.hpp b/openVulkanoCpp/Scene/Text/FontAtlasType.hpp new file mode 100644 index 0000000..c7614c9 --- /dev/null +++ b/openVulkanoCpp/Scene/Text/FontAtlasType.hpp @@ -0,0 +1,42 @@ +/* + * 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 + +namespace OpenVulkano::Scene +{ + class FontAtlasType + { + public: + enum Type : int16_t + { + SDF = 0, + MSDF, + BITMAP, + UNKNOWN + }; + + static constexpr std::string_view DEFAULT_FG_SHADERS[] = { "Shader/sdfText", "Shader/msdfText", "Shader/text" }; + + constexpr FontAtlasType(Type type) : m_type(type) {} + + [[nodiscard]] constexpr Type GetType() const { return m_type; } + + [[nodiscard]] constexpr auto GetName() const { return magic_enum::enum_name(m_type); } + + [[nodiscard]] constexpr const std::string_view& GetDefaultFragmentShader() const + { + return DEFAULT_FG_SHADERS[static_cast(m_type)]; + } + + [[nodiscard]] constexpr operator Type() const { return m_type; } + + private: + Type m_type; + }; +} \ No newline at end of file