Add XCUI new editor sandbox phase 1

This commit is contained in:
2026-04-05 04:55:25 +08:00
parent e23f469e5a
commit 67a28bdd4a
76 changed files with 14671 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
#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