#pragma once #include "IXCUITextAtlasProvider.h" struct ImGuiContext; namespace XCEngine { namespace Editor { namespace XCUIBackend { class ImGuiTextAtlasProvider final : public IXCUITextAtlasProvider { public: ImGuiTextAtlasProvider() = default; explicit ImGuiTextAtlasProvider(::ImGuiContext* context); void SetContext(::ImGuiContext* context); ::ImGuiContext* GetContext() const; bool GetAtlasTextureView(PixelFormat preferredFormat, AtlasTextureView& outView) const override; std::size_t GetFontCount() const override; FontHandle GetFont(std::size_t index) const override; FontHandle GetDefaultFont() const override; bool GetFontInfo(FontHandle font, FontInfo& outInfo) const override; bool GetBakedFontInfo(FontHandle font, float fontSize, BakedFontInfo& outInfo) const override; bool FindGlyph(FontHandle font, float fontSize, std::uint32_t codepoint, GlyphInfo& outInfo) const override; private: ::ImGuiContext* ResolveContext() const; ::ImGuiContext* m_context = nullptr; }; } // namespace XCUIBackend } // namespace Editor } // namespace XCEngine